goalSprite: ""
Sprite{
name: "still"
- source: "content/Bear0.png"
+ source: "content/BearSheet.png"
frames: 1
frameWidth: 256
frameHeight: 256
}
Sprite{
name: "blink"
- source: "content/BearB.png"
+ source: "content/BearSheet.png"
frames: 3
+ frameX: 256
+ frameY: 1536
frameWidth: 256
frameHeight: 256
frameDuration: 100
}
Sprite{
name: "floating"
- source: "content/Bear1.png"
+ source: "content/BearSheet.png"
frames: 9
+ frameX: 0
+ frameY: 0
frameWidth: 256
frameHeight: 256
frameDuration: 160
}
Sprite{
name: "flailing"
- source: "content/Bear2.png"
+ source: "content/BearSheet.png"
frames: 8
+ frameX: 0
+ frameY: 768
frameWidth: 256
frameHeight: 256
frameDuration: 160
}
Sprite{
name: "falling"
- source: "content/Bear3.png"
+ source: "content/BearSheet.png"
frames: 5
+ frameY: 1280
frameWidth: 256
frameHeight: 256
frameDuration: 160
if (img.height() == frameHeight && img.width() < maxSize){//Simple case
p.drawImage(0,y,img);
state->m_rowY = y;
+ state->m_rowStartX = state->m_frameX;//In case it was offset, but we took the simple route of not chopping out the other bits
y += frameHeight;
}else{//Chopping up image case
state->m_framesPerRow = image.width()/frameWidth;
state->m_rowY = y;
int x = 0;
- int curX = 0;
- int curY = 0;
+ int curX = state->m_frameX;
+ int curY = state->m_frameY;
int framesLeft = state->frames();
while (framesLeft > 0){
if (image.width() - x + curX <= img.width()){//finish a row in image (dest)