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 / CreateText problem with depth and drawing

Author
Message
Shock
AGK Developer
22
Years of Service
User Offline
Joined: 24th Oct 2002
Location: United Kingdom
Posted: 21st Dec 2014 18:05
Hi all,

I'm trying to make a really simple program to write some text on a square, but i'm stuck and wondering if you could help me

I'd like to draw a square, and then position some text on top of it.



With this code however, the text is always placed behind the square, even though the text depth is set to 0. I'm guessing it's because the box needs drawing every loop, and draws over the text. Any ideas how I could draw ontop of the square?

Thanks,
Shock.
Shock
AGK Developer
22
Years of Service
User Offline
Joined: 24th Oct 2002
Location: United Kingdom
Posted: 21st Dec 2014 18:09
(p.s.) I tried using CreateRenderImage to make the box into a sprite instead, but ran into all sorts of problems when running this on devices with different resolutions, seemed to cut out half the box.
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 21st Dec 2014 19:13
According to the documentation
Quote: "Lines [of the box] appear above all other drawing except the Print command"


Therefore to achieve this effect, your best bet is to use a sprite like this.



Hope that helps.

Shock
AGK Developer
22
Years of Service
User Offline
Joined: 24th Oct 2002
Location: United Kingdom
Posted: 21st Dec 2014 19:26
Ah thanks very much, that works a treat

After a bit of research, looks like I completely misunderstood the principles/uses of the "draw" commands.

Login to post a reply

Server time is: 2024-11-25 14:39:22
Your offset time is: 2024-11-25 14:39:22