Author Topic: Scroll Sprite Into View doesn't work with virtual sizes?  (Read 3219 times)

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
ScrollSpriteIntoView(bool UseMargins) doesn't seems to work with virtual sizes.  I made a map:

ScrollableSize: 400,15
Scroll Margins: 96,128,128,96

And a layer:

ScrollRate: 1
Height: 15
Width: 25
VirtualHeight: 15
VirtualWidth: 400

It doesn't seem to scroll farther than 25 tiles.
« Last Edit: 2007-04-09, 01:48:44 PM by durnurd »
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Scroll Sprite Into View doesn't work with virtual sizes?
« Reply #1 on: 2007-04-10, 06:12:09 AM »
Is your tile size 16?  400/16 = 25.  25 tiles would be your scrollable width.  Is it coincidence that you chose the most confusing number for your virtual width ... confusing because it's hard to distinguish what's a tile width and what's a pixel width? :)

Keep in mind that the map's ScrollableSize is in pixels and the layer's VirtualWidth is in tiles.  Try going through the map manager's wizard and see if it calculates the right ScrollableSize for your new virtual size.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Scroll Sprite Into View doesn't work with virtual sizes?
« Reply #2 on: 2007-04-10, 08:55:55 AM »
I am having trouble figuring out how all the different numbers are used.  After playing with random settings, it changed my scrollwidth to 6400.  But I still have great difficulties understanding what all the different numbers affect.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Scroll Sprite Into View doesn't work with virtual sizes?
« Reply #3 on: 2007-04-10, 05:46:10 PM »
What do you need -- just a description of the numbers?  I assume you already saw the description provided when the field has focus.  Is there any way to make it more clear?  Here's my summary:

ScrollableSize: Determines how far the map is allowed to scroll.  This is necessary because the layers within the map don't necessarily have to be entirely viewable, and changing the scroll rate or view size can affect how much of a layer can be seen.

Scroll Margins:  These are only used with ScrollSpriteIntoView and determine how much of a margin to leave between the edge of the sprite and the edge of the display when viewing this map.  This is necessary because it's much easier to define this once rather than always providing it on every sprite or finding a way to provide it on the ScrollSpriteIntoView call.

ScrollRate: For each pixel of map scrolling, how many pixels does this layer scroll.  This is necessary to support automated parallax scrolling.

Height: How many rows of tiles does the layer store in its data.  This is necessary to determine how much space to allocate for storing tile data in the layer, and how many unique tile rows there can be in the layer.
Width: How many columns of tiles does the layer store in its data.  This is necessary to determine how much space to allocate for storing tile data in the layer, and how many unique columns there can be in the layer.

VirtualHeight: How many rows of tiles can the layer provide/draw.  If a requested row index is beyond the actual height (above), the data will "wrap" and draw another instance of the layer below the first instance.  This is necessary because you may not want a particular layer to draw tiles beyond its edges even though you may want to allow the map to scroll beyond a layer's edge.

VirtualWidth: How many columns of tiles can the layer provide/draw.