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 DBPro Corner / Sprite Focus

Author
Message
Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 17th Oct 2006 22:35
Hi, im making like a 2d game where you control 4 different sprites and i want, for example, when you select one, the camera kinda zooms in and focuses on it when you move it... is this possible?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Oct 2006 23:40
You can either do a real zoom (which takes the color of each pixel and makes boxes of each color) or you can increase the size of the sprites with the "scale sprite" command.

If you're using Classic a real zoom will slow your program down to a crawl.
Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 18th Oct 2006 21:23
how do i do a real zoom?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Oct 2006 08:03 Edited at: 19th Oct 2006 08:04
Here ya go.

Works best in Pro... in Classic for some unknown reason each box drawn is automatically synced so it's real slow.



The above puts the zoom on the same screen but it would be better to work on a different screen and show the zoom on the main screen... that way you don't have to worry about the zoom interferring with getting the colors of the pixels.

If you (or anybody) has any questions about the code ask away.

Note: Attached is the image I used but you can use any image you want.

Attachments

Login to view attachments
Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 19th Oct 2006 19:23
How do i move the view to follow the zoomed sprite when it moves?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Oct 2006 21:47
This line...


Needs to be changed to the current sprite coordinates (spritenumber is of course whatever sprite number you're working with):

Login to post a reply

Server time is: 2024-11-27 05:46:47
Your offset time is: 2024-11-27 05:46:47