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.

Dark GDK / 2D Camera

Author
Message
ketchup mustard
16
Years of Service
User Offline
Joined: 31st Jan 2008
Location:
Posted: 19th Apr 2009 20:53
Howdy, my title is pretty self-explanatory. I was trying to find a function or block to get a camera to follow my /2D/ image or sprite. Is this possible? How? thx^^

Don't Clap, Just Throw Money!
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 20th Apr 2009 16:34
Do you mean like such as on Mario that when you walk the camera ''follows you''.

if so i think this is just the background scrolling. im sure theres a function/command for it somewhere.

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 20th Apr 2009 16:51
found one


"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 21st Apr 2009 22:47
The command says it's for 3D.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
ketchup mustard
16
Years of Service
User Offline
Joined: 31st Jan 2008
Location:
Posted: 22nd Apr 2009 03:43
Lilith is right
Quote: "The command says it's for 3D."

preciate it Xiva.

Im really looking for a megaman X type deal - where u move megaman anywhere along a map. Correct me if I'm wrong, but i think in that situation, the map stays put while megaman moves around it...

ps Forest sed: Mama always sayd, life is like a box a chocalits, you neva know whatcha gonna git. xP

thank y'all ;p

Don't Clap, Just Throw Money!
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 22nd Apr 2009 06:39
More likely the background is tiled and the background is made to move by carefully arranging what tiles are in the viewport and where each tile began, both horizontally and vertically. The Megaman character is kept towards the middle of the screen as the background is made to scroll until Megaman gets too close to the borders. Even then they may have allowed a half screen margin for the borders. You have to keep check where the character is with regards to the entire background map but calculate what the upper left corner of the display needs to be to keep the character centered. More calculations will need to be done for each of the other characters that move within the background.

Another potential solution would be to have an image that encompasses the entire background, express it as a sprite then calculate the UV values to define the boundaries. But that would require a massive image unless you used an 8 or 16 bit color scheme.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office

Login to post a reply

Server time is: 2024-11-25 13:46:40
Your offset time is: 2024-11-25 13:46:40