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 / Text or sprites infront of graphics made by drawing commands?

Author
Message
Space Dream Studios
Competition Prize Winner 2014
14
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 8th Nov 2014 13:25
May be a silly question, but how is it possible to get sprites and/or text infront of the 2D drawing commands, like DrawBox....?

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Nov 2014 13:30
hmm,
SetSpriteDepth,DrawSprite,
maybe split the sync() // = Update() Render() Swap()
Render () can split into
Render2DBack ( )
Render2DFront ( )
Render3D ( )

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Space Dream Studios
Competition Prize Winner 2014
14
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 8th Nov 2014 13:56 Edited at: 8th Nov 2014 13:57
@Markus: thanks for your answer, but yes, thought similar, but render2DBack, for example, is for ALL 2D graphics, so text, sprites and drawing commands are all within this category...? So the question is, how do I get text and sprites infront of graphics, drawn by the drawing commands. HELP says, that graphics, created by drawing commands, like DrawBox, are always ontop of everything on the Screen.... But I need Text/Sprites to appear over drawn graphics.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Nov 2014 15:39
em, u need drawbox in realtime or can u make a sprite from it
with GetImage function or SetRenderToImage?

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Nov 2014 16:27
I think Markus has the best answer - SetRenderToImage

This should keep things simple in your code. Set Render to Image, draw lines etc, then set render back to screen. If your image is attached to a sprite which is on top of everything else, you don't need any more code.

Quidquid latine dictum sit, altum sonatur
Space Dream Studios
Competition Prize Winner 2014
14
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 10th Nov 2014 11:36
Thanks guys, that's a good suggestion!

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 10th Nov 2014 12:32
Hi Dpace Dream Studios. Here is a quick example of printing on top of DrawBox:



Hope this helps.

Login to post a reply

Server time is: 2024-11-25 11:52:46
Your offset time is: 2024-11-25 11:52:46