Dynamic Sprite sheets

Brent

Question regarding the co-ordinate system as I am getting a bit confused…

my sprite sheet data is as follows (snippet)

 frames = {  
  
 {  
 -- dog\_wakesup\_00000  
 x=406,  
 y=440,  
 width=200,  
 height=84,  
  
 sourceX = 82,  
 sourceY = 632,  
 sourceWidth = 1024,  
 sourceHeight = 768  
 },  
 {  
 -- dog\_wakesup\_00001  
 x=406,  
 y=440,  
 width=200,  
 height=84,  
  
 sourceX = 82,  
 sourceY = 632,  
 sourceWidth = 1024,  
 sourceHeight = 768  
 },  
  

my main.lua file is as follows

display.setStatusBar( display.HiddenStatusBar )  
  
print( 1 / display.contentScaleX, 1 / display.contentScaleY )  
  
local definitions = require ('data')  
  
local imageSheet = graphics.newImageSheet("testing.png", definitions.options )  
local character = display.newSprite( imageSheet, definitions.sequenceData )  
character:setReferencePoint( display.CenterReferencePoint )  
  
character:setSequence( "left")   
character:play()  
  
character.x = display.contentWidth/2  
character.y = display.contentHeight/2  
  

with me setting the x and the y values to the center of the screen I would expect the sprite to be in the middle of the screen…

however the sprite is at the bottom left… what am I missing here?

Thanks again [import]uid: 67619 topic_id: 34423 reply_id: 136978[/import]

Hi Vic,
At this point, I think we’ll solve this easier if you just e-mail me the project. Go ahead and zip it up and send it to bjsorrentino (at) yahoo (dot) com.

Brent [import]uid: 200026 topic_id: 34423 reply_id: 137017[/import]

Brent…

Just sent it to you email…

Thanks

Vik [import]uid: 67619 topic_id: 34423 reply_id: 137032[/import]