|
  
|
|
|||||||
| Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Experienced Zuner
|
I have a checkers board that I'm working on that is 400 by 400. You of coarse know that the zune resolution is 240 by 320. I want to be able to let the user decide on what zoom level they want to play checkers at. Default would be to fit the 400 by 400 at a square ratio on the screen. It of coarse won't use the whole screen. Then the user can hold the play button and the up button to zoom into a custom resolution to 400 by 400, It will only display 240 by 320 of the 400 by 400 texture at a time, but I will make it scroll around the board.
What is the code to draw textures at the different zoom levels? I have tried coding it but, either it doesn't draw my texture or it fits the texture to the screen. Manic Miner uses this zoom/ scroll technique somewhat.
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#2 (permalink) |
|
ad majorem dei gloriam
Administrator
Ultimate Zuner Join Date: Jan 2007
Posts: 6,610
Reputation: 474
|
you just adjust the parameters of your rectangle...
Code:
new Rectangle(0,0,200,200); //zoomed out new Rectangle(0,0,400,400);//zoomed into top left new Rectangle(-160,-80,400,400);//zoomed into bottom right
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. |
|
|
|
|
|
#3 (permalink) |
|
Experienced Zuner
|
Thank you very much... That is exactly what I needed... How did you figure out that -160 , -80 would draw the texture zoomed in at the bottom right?
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Last edited by Rockman87 : 09-09-2008 at 10:15 AM. ![]() |
|
|
|
|
|
#4 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 312
Reputation: 78
|
What you would use this:
Code:
Rectangle destination = new Rectangle(0, 0, 240, 320); Rectangle source = new Rectangle(); Spritebatch.Draw(texture, destination, source); Hope this helps!
__________________
~Shutout5591~ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. If you like me work or I have helped you, + Rep me! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#5 (permalink) |
|
ad majorem dei gloriam
Administrator
Ultimate Zuner Join Date: Jan 2007
Posts: 6,610
Reputation: 474
|
honestly I think this is one thing there's a few ways to do it. Mine works just as well as long as you aren't sloppy and makes more intrinsic sense to me.
I figured those numbers by 240-400=-160 320-400=-80
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. |
|
|
|
|
|
#6 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 312
Reputation: 78
|
yea, theres definitely more than 1 way to do it. Some feedback from OP would be great!
__________________
~Shutout5591~ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. If you like me work or I have helped you, + Rep me! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#7 (permalink) |
|
Experienced Zuner
|
Right now I'm using nurta's recommendation... I havn't had time to try others... been working like crazy. But, everything is working fine. thanks for the help
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
![]() |
| Thread Tools | |
|
|
| |