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 / want to create a section of scrolling graphics in a rectangle shape.

Author
Message
dman
21
Years of Service
User Offline
Joined: 21st Feb 2005
Location:
Posted: 16th Mar 2011 02:53
the graphics will be scrolling with in a rectangle shape and place it any where on screen, the graphics I'm using is 2D.

Can I do this using a camera ?

Can I mix 2D with 3D ?

how can I create this effect ?
GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 16th Mar 2011 06:28
I am curious to hear what others have to offer on this question.

I am currently using my own modified version of d3d_func that allows me to set viewports:



Then, all drawing commands after that only affect that area, which you could set as your rectangle shape. If you "paste image" and the image spills out of the box, the extra is ignored. After you are done, you can use "d3d_resetviewport" to go back to normal. The scrolling can be done by adjusting how you paste the image.

That is how I would do it. I know you can probably do something similar with a camera but I haven't tinkered with it at all and can't help there.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Mar 2011 09:19
The SET SPRITE TEXTURE COORD (I think that's what it's called anyway) will let you set the UV coordinates of a sprite. So if you used a variable going from 0.0 to 1.0 slowly, you could use that as your X UV offset. That would work great on a big repeating image, like a horizontally repeating backdrop.

Health, Ammo, and bacon and eggs!
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 16th Mar 2011 10:59
You can do it without scrolling, you just mask out the camera's picture with a black/whatever colored or patterned shape. And then you setup any kind of level you want, no matter what D you want to use.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Mar 2011 11:43
Or just set the camera view (SET CAMERA VIEW xa,ya,xb,yb) - but I'm thinking he wants full control over it.

Health, Ammo, and bacon and eggs!
dman
21
Years of Service
User Offline
Joined: 21st Feb 2005
Location:
Posted: 16th Mar 2011 22:00
yeah a camera is what I want to use or a view port so I can scroll within the view port.

I'm using the line command to draw and scroll.
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 16th Mar 2011 22:12
You can make a second camera and then use 'set current bitmap -<camera id>' to draw directly to the camera.
dman
21
Years of Service
User Offline
Joined: 21st Feb 2005
Location:
Posted: 17th Mar 2011 00:56
sounds good, I'll try it

Login to post a reply

Server time is: 2026-07-17 13:58:29
Your offset time is: 2026-07-17 13:58:29