myRegion = CreateObject("roRegion", bitmap, sprite.Getx(), sprite.GetY(), bitmap.ifDraw2D.GetWidth(), bitmap.ifDraw2D.GetHeight())
printAA(myRegion)
printAA(bitmap)
print "here " sprite.Getx().ToStr(), sprite.GetY().ToStr(), bitmap.ifDraw2D.GetWidth().ToStr(), bitmap.ifDraw2D.GetHeight().ToStr()
invalid
roBitmap
here 1397 440 137 205
sprite = spriteObj.sprite
print "here is the sprite x " + sprite.Getx().ToStr()
print "here is the sprite y " + sprite.GetY().ToStr()
oldRegion = sprite.GetRegion()
print "oldRegion data: " + chr(10) + oldRegion.ifRegion.GetX().ToStr() + chr(10) + oldRegion.ifRegion.GetY().ToStr() + chr(10) + oldRegion.ifRegion.GetWidth().ToStr() + chr(10) + oldRegion.ifRegion.GetHeight().ToStr() +chr(10)
here is the sprite x 157
here is the sprite y 440
oldRegion data:
0
0
137
205
"NewManLiving" wrote:
Your question is still related to Joel's answer. A region is located inside of a bitmap and cannot extend beyond the bounds of its bitmap. So your regions x and y positions would reflect the positions you created the region at. If you offset your region then those coordinates will change inside of the bitmap. Now a sprites x and y are where you locate it on the screen. It has nothing to do with the regions x,y. Like taking a picture of a landscape. The picture is a region or portion of the landscape and the Sprite would be the picture frame that you can hang anywhere on the wall. The pictures x y is where you took the picture in relation to the landscape. The sprites x,y is the location you hung the picture on the wall
"NewManLiving" wrote:
Yes the sprites SetRegion