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 / Cannot Draw Text Over DrawBox

Author
Message
Divided
FPSC Reloaded TGC Backer
10
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 2nd Jul 2019 09:03
Hello,

Can someone please confirm if this is a bug.

Description:
You cannot draw text over a box even if you set the text to be the top layer.

UAT1:
- Create a text object
- Set text object to be the front of the screen
- Draw a box not filled that should cover the text
- Set the text position to be over the newly drawn box
- Redraw text if necessary
- Observe that the text should be visible

UAT2:
- Create a text object
- Set text object to be the front of the screen
- Draw a box filled that should cover the text
- Set the text position to be over the newly drawn box
- Redraw text if necessary
- Observe that the text should be visible

NOTE: Make the box color and the text color opposites on the color wheel such that the text stands out if drawn on top.

Also note I found this bug using a Mac and the Mac version of AppGameKit Studio 0.95

If it is found that you can draw text over a box then I must have something funky going on in my code.
Real programmers don't comment their code, because if it was hard to write it must be hard to read!

- PixHil Entertainment
Download Pixel Smasher on the App Store today!
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 2nd Jul 2019 09:22
It is not a bug

Look at the documentation for DrawBox
https://www.appgamekit.com/documentation/Reference/Core/DrawBox.htm

Draws a 2D box from one point on the screen to another with a chosen color using lines. Lines appear above all other drawing except the Print command and can be used with the GetImage function or SetRenderToImage to create new images.

This was explained in another thread that there are a few commands DrawLine,DrawBox,DrawElipse that appear on top of ALL other rendering. What you can do is render a box and not clear the screen then render your text on top of that.

A much better method of drawing boxes is using a white sprite...Set the colour of the sprite...call drawsprite() and you can control where it is in the draw order. Just remember to hide it after.
Divided
FPSC Reloaded TGC Backer
10
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 2nd Jul 2019 18:06 Edited at: 2nd Jul 2019 18:08
Thanks guys - feel like I should have read the documentation more closely.

When the documentation talked about specifically the print command I figured it was all text based commands.

Seems like a bad design in my opinion but I'm sure there's a reason for it!

Cheers
Real programmers don't comment their code, because if it was hard to write it must be hard to read!

- PixHil Entertainment
Download Pixel Smasher on the App Store today!

Login to post a reply

Server time is: 2024-03-29 13:18:24
Your offset time is: 2024-03-29 13:18:24