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.

DarkBASIC Professional Discussion / Sprite and Text Clipping problem

Author
Message
New Coder Skilless
13
Years of Service
User Offline
Joined: 4th Oct 2012
Location:
Posted: 23rd Oct 2012 11:02
Hi guys

When I'm adding Sprites to my menu function, unless the whole sprite is on the screen, the sprite will not draw. This is a real concern for me as my Menu screen has the "buttons" flying in from the left of the screen. The problem is the sprites are 512x32 and the text is drawn over the sprite, and unless the whole text or the whole sprite is on the screen, it will not be rendered.

Is there an additional parameter I need to set before I render any 2d text or sprites?
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 23rd Oct 2012 15:38
yeah. normally you NEVER use "sprite" command in loop
you do it to create sprite.
then you set up the sprite paramters with "set sprite" command.
to render sprite after you finished all of those steps, just do "paste sprite" in loop

here is a quick example:

load image "myImg.jpg",1
sprite 1,0,0,1
set sprite 1,0,1
hide sprite
sync on
do
//draw sprite 1st, then text;
paste sprite 1,0,0
text 0,0,"Text ON Sprite"

sync
loop

Advanced Updater for your games!

Login to post a reply

Server time is: 2026-07-07 11:46:44
Your offset time is: 2026-07-07 11:46:44