Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / draw text to image ?

Author
Message
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Dec 2010 10:27
And rotate the text. Basically, I need to write text in a circular fashion around a wheel, think Wheel of Fortune but with words instead of money around the wheel. Because the words can change depending on user input from the start of the game, external graphics isn't much of a choice.

My only thought is display the text in a chosen font, use "get image", then make a sprite and rotate it to the correct position, then grab the final image of the wheel. I'm sure that could work but I don't think it'd look very clean because any AA on the text edges would be lost when displayed on top of the wheel image.

Anyone have a better idea?

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Dec 2010 10:41
You could use cloggy's d3d plugin to create 3D text and then use 'get image'...

I believe some of the paid plugins might have sprites which don't get messed up when rotated but I haven't used them.

Is there a reason you can't use a drawing package like GIMP to make these images? Maybe the text needs to be editable?

BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Dec 2010 12:09
I did exactly this for...a wheel of fortune!

I used a bitmap font with feathered edges in PNG format. I applied by creating a sprite of the wheel, rotating to the right angle, pasting to an alpha-based bitmap, paste text, then rotate again and so on.

Basically think in reverse...rotate the wheel and apply the text horizontally each time.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Dec 2010 20:31
Quote: "Is there a reason you can't use a drawing package like GIMP to make these images? "

Because the text on the wheel is controlled by an external, user-editable file. So unless I made an image of every english word....


Thanks Bat, didn't think of rotating the wheel instead. Guess I gotta make a bitmap font now.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 24th Dec 2010 21:59 Edited at: 24th Dec 2010 22:19
Here is some code that makes a wheel with letters.



You could map the letters to the planes according to whatever they need to spell out. Here's a version that asks for input and then spells out the phrase on the wheel.



Login to post a reply

Server time is: 2026-07-21 20:46:00
Your offset time is: 2026-07-21 20:46:00