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 Classic Chat / DrawBox doesn't draw over Sprite

Author
Message
MMT
6
Years of Service
User Offline
Joined: 12th Mar 2018
Location:
Posted: 13th May 2018 09:44
Documentation says "lines appear above all other drawing except the Print command".

But the box appears behind my sprite.

Is there a reason for this?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 13th May 2018 16:52
Sprite commands always display in front of drawing commands
Quote: "lines appear above all other drawing except the Print command"."

That means if you was to draw other things or print something that utilizes the AGKS drawing, the box will appear over the top of it
for example
will draw a box on top of any print commands and it wont draw the sprite. If you want to draw the sprite you would add the
command drawsprite(id) but any sprite above your drawing location that is still visible will still be shown in front of the draw commands.
If you no longer want the sprite visible you should set the sprites visibility to 0. By drawing the sprite to the image then drawing the box
then setSpriteVisibility(id,0) might give the effect. Or you could grab an image and make that a sprite and use the set sprite depth command
sorry but that's the way it works not sure why but I have found it much better this way.
fubar
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 14th May 2018 18:32
Do you have some code, MMT? Because this code:



displays a blue sprite, with a red box drawn over it, and the white printed data.

Are you seeing something different?

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th May 2018 20:01
Good example @Rich Dersheimer

Works because it draws the box before every call to sync, i figured MMT must be doing something else which updates
the sprite but doesnt redraw the the box. Really need to see some code to help more
fubar

Login to post a reply

Server time is: 2024-04-26 07:10:44
Your offset time is: 2024-04-26 07:10:44