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.

Newcomers AppGameKit Corner / Background for my gui button

Author
Message
Hubert BAYRE
6
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 30th Nov 2017 11:25
Hello.
I'm trying to create some gui buttons for my application.

1) So i use 'DrawBox' for the button background and SetTextPosition for the caption.
But i don't know how to draw the box before the text ! My filled drawbox overlap the text !
Could you help me ?



2) Perhaps you have another idea. Is there a method to use an image (1x1 px), change the depth, and stretch it (how to)?

Many thanks!
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 30th Nov 2017 22:05
DrawBox() will always draw over the text because of the technology used. You can't set its depth.

You can createSprite(0), resize, set its colour and put that behind the text using SetSpriteDepth() and SetTextDepth()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Hubert BAYRE
6
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 1st Dec 2017 20:55
Perfect ! Many thanks.
puzzler2018
User Banned
Posted: 3rd Dec 2017 00:12
Render2DFront()

will do it - i use in my latest code

D

Login to post a reply

Server time is: 2024-03-29 09:30:29
Your offset time is: 2024-03-29 09:30:29