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.

AppGameKit Studio Chat / Drawing text over an image fails

Author
Message
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 6th Sep 2020 11:12
I have an image that I want to put text on. I first clear the location of any old text by drawing a box over it and then drawing the new text. This is theory. In practise this does not work. The box is drawn OVER the text, even though the text is drawn afterwards...

Dutch
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 6th Sep 2020 13:37
"The box is drawn OVER the text"

Correct. Boxes and lines are drawn over everything except PRINTED text. That is different from created text. Even if you SetTextDepth(id,0), it will still be under Line/Box/etc drawing.


blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 6th Sep 2020 20:58
Draw your box
Render()
Draw your other stuff
Sync()
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 6th Sep 2020 21:32
OOOH! I've been avoiding Render() because I used to get performance hits when I'd add that in to update stuff. I need to revisit that. Thanks for posting that, blink0k!
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 7th Sep 2020 19:28 Edited at: 9th Sep 2020 20:51
Tried Render() but it draws a lot of other stuff on the image set to render to... Might have to render to screen first.
Dutch
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 7th Sep 2020 19:48
Current workaround: don't use drawbox to clear the cell, but draw previous(old) text in background colour first a couple of times and then draw the new one in correct colour.
Dutch

Login to post a reply

Server time is: 2024-04-26 09:10:50
Your offset time is: 2024-04-26 09:10:50