|
Post by junkatana on Dec 28, 2016 13:46:08 GMT -5
I have some problem when set scroll to Down, because start at the end of map. I know that's the problem can be my logic, so, what is the best way approach to user scroll DOWN?
My code bellow:
Dim FullMap(39, 55) as Integer
pallettes map_color, 1, 0, 16 ´load pallette from map_color loadtiles map_tile, 139, 273 ´load from map tiles
reload map ´tilemap
for mY=0 to 55
for mX=0 to 39
readint FullMap(mX, mY)
next mX
next mY
for mY=0 to 55
for mX=0 to 39
drawtile FullMap(mX, mY)+pallette(1)+273,mX, mY
next mX
next mY
setscrollmode HSCROLL_OVERALL, VSCROLL_OVERALL
do scroll DOWN, 1 loop
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 28, 2016 15:06:10 GMT -5
Kind of hard to troubleshoot when you don't really say what the problem is First, you don't need 2 sets of loops. Just draw the tile to the plane in the same loop since you already pulled the value with ReadInt. Second, you don't need to set the scroll mode to overall on either the horizontal or vertical scroll, unless you had changed it previously, as that's the default scroll mode. Next, try putting "Sleep 1" after the scroll command. Then, tell us what issue you're having, or toss up the entire source so we can see exactly what you're seeing (I didn't see any tile data in your post, but that could be my phones fault).
|
|
|
Post by junkatana on Dec 28, 2016 16:54:40 GMT -5
Kind of hard to troubleshoot when you don't really say what the problem is First, you don't need 2 sets of loops. Just draw the tile to the plane in the same loop since you already pulled the value with ReadInt. Second, you don't need to set the scroll mode to overall on either the horizontal or vertical scroll, unless you had changed it previously, as that's the default scroll mode. Next, try putting "Sleep 1" after the scroll command. Then, tell us what issue you're having, or toss up the entire source so we can see exactly what you're seeing (I didn't see any tile data in your post, but that could be my phones fault). Sorry about that and thanks for tips. So the big problem is, when the map scroll down, start at the end of my scene. I need start at the bottom, where is my start scene. Sorry about my english. Can you understand me?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 28, 2016 17:34:09 GMT -5
I think I get what you're saying. You want the screen to start at the very bottom?
scroll2 down, 224 ' 240 if you're in PAL mode
What Scroll2 does is scrolls the plane to that location. You could also do: Scroll down,224 (not in a loop) and this will scroll the plane by 224 pixels in 1 jump, relative to where the position currently is (ie, if you scrolled down 6, then did a 224, the plane would be at x = 224). Scroll2 puts the plane at that exact location, regardless of its current position, so Scroll2 puts the plane at x = 224, even if it were previously at x = 50.
You'll want to scroll "up" with a loop if you want it to scroll on screen.
I hope that helps!
|
|
|
Post by junkatana on Dec 28, 2016 17:46:24 GMT -5
I think I get what you're saying. You want the screen to start at the very bottom? What Scroll2 does is scrolls the plane to that location. You could also do: Scroll down,224 (not in a loop) and this will scroll the plane by 224 pixels in 1 jump, relative to where the position currently is (ie, if you scrolled down 6, then did a 224, the plane would be at x = 224). Scroll2 puts the plane at that exact location, regardless of its current position, so Scroll2 puts the plane at x = 224, even if it were previously at x = 50. You'll want to scroll "up" with a loop if you want it to scroll on screen. I hope that helps! Help so much elusive, thank you.
|
|