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 / Method for clipping sprites in viewport

Author
Message
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 23rd Mar 2010 17:27
Hello everyone-

I'm making a level picker screen for my game, where I want to have a scrollable list of levels inside a "frame" graphic. I know how to do everything I need except how to perform clipping so that the level names (pasted sprites) don't go through this frame.

I know of a clunky solution to use a frame which is the thickness of the bitmap font and draw it last so it will draw over the bottom/topmost lines. But I'd like to have a thinner frame with a nice clean clip of the text above it.

Any ideas?


A 3D marble platformer using Newton physics.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Mar 2010 21:06
You could size the sprite to whatever you need, then adjust the UV coordinates of the sprite to suit the area of texture you need.

SET SPRITE TEXTURE COORD Spr,Corner,X#,Y#


Health, Ammo, and bacon and eggs!
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 23rd Mar 2010 21:10
Thanks VanB I'll give it a try.


A 3D marble platformer using Newton physics.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Mar 2010 23:06
If these are your only sprites, then you can set the sprite draw area by using the SET SPRITE VIEW command from my plug-ins.

Login to post a reply

Server time is: 2026-07-26 21:12:21
Your offset time is: 2026-07-26 21:12:21