hi there..
Soooo..
Now that i managed to create a Scrollview, 2 Scrollbars and a Texture inside the View, i want to add a "Cursor" to the System.
Therefor i created a BoxCollider, that is covering the ScrollView Size exactly ( Size.x = 256, Size.y = 480).
So now, the Scrollview visible Field should be splitted into 32*32 pixel areas (i want to create a tilemapper). The CursorSprite has a Size of 32*32 pixels.
Means, Inside the ScrollView is space for 8*15 Tiles beeing visible.
A Tileset can be as large as wanted (power of 2) - so the ScrollView can be scrolled..
My Question now:
When i move my Mouse over the ScrollView, the CursorSprite should be placed over the current hovered tile on the tileset. I know there is UICamera.lastHit.point.. The BoxCollider Size is written above, but the Resulting Position of the lastHit.point is:
X between -1.8 on the left and -1.1 on the right
Y between 1.2 on Top and -0.3 on Bottom
Z stays 0..
How can i get the Pixel Position on the Collider?
here´s a current Screenshot:
http://fs5.directupload.net/images/151202/85ohvul6.pngThe result should be:
if Mouse is covering Position "49,12,0", it should be placed at "(int)((49/32)*32)-16, (int)(((TileSetHeight-12)/32)*32)+16, 0" to cover the current Mouseover tile.