KrunkSplein
Newcomer
- Joined
- Oct 4, 2004
- Messages
- 4
Working on a tile engine, and I was trying to implement scrolling. I'm going to have a 600x600 (arbitrary decision, may be changed) section of window devoted to displaying a map (the rest is for interface). My question is how would you implement scrolling in case the map went beyond 600 by 600? I was tinkering around and tried:
mapDev.Transform.View = Matrix.Transform(offsetx, offsety,0)
but that crashed my program. I've already implemented the code so that it doesn't render off-screen tiles, now I just need to be able to move the camera so that we can GET to the off-screen tiles.
Also, I'm looking for a means to center the view if the map is smaller than 600 by 600, so that instead of being bunched up in the top left, it could look better. Though I have a suspicion that my two problems have one solution.
Thanks in advance,
Krunk
mapDev.Transform.View = Matrix.Transform(offsetx, offsety,0)
but that crashed my program. I've already implemented the code so that it doesn't render off-screen tiles, now I just need to be able to move the camera so that we can GET to the off-screen tiles.
Also, I'm looking for a means to center the view if the map is smaller than 600 by 600, so that instead of being bunched up in the top left, it could look better. Though I have a suspicion that my two problems have one solution.
Thanks in advance,
Krunk