alright, after a few day of figuring out how to display correctly the hud and the room, i successed it, unfortunately, i encountered a weird bug that is driving me nuts... so, here the problem i have:
function Draw(HUD) if(drawHUD == true) then BackgroundColor(0) Clear() DrawTilemap(0, 0, 40, 8) drawHUD = false else BackgroundColor(31) Clear() DrawTilemap(16, hudHeight, 288, 112) end end function Draw(ROOM) BackgroundColor(31) Clear() DrawTilemap(16, hudHeight, 288, 112) end function Draw(OBJECTS) -- body end function Draw(SPRITES) BackgroundColor(31) Clear(16, hudHeight, 288, 112) DrawTilemap() -- character position starter. local newX = 48 local newY = 121 --that line of code will tell where to get the sprite data. so, the game will be able to animate them. local frameData = speakingNormal2Frames[idleFrame] -- that little "if(frameData ~= nil) then" is REALLY important to add. so, it will not display "out of the range" -- everytime i start the game. -- each variable will be called from the array code at the start of file. if(frameData ~= nil) then DrawSprites(frameData.spriteData.spriteIDs, newX, newY, frameData.spriteData.width) end -- We are going to detect if the mouse is on the screen. When the cursor is within the bounds -- of the DisplayChip, we will show its x and y position. if (mousePos.x < 0 or mousePos.y < 0) then else -- We also need to draw it to the display. We'll be using the DrawSprites() method to take the four cursor sprites and render them in a 2 x 2 grid. DrawSprites(greenCursorSprites, mousePos.x, mousePos.y, cursorWidth) OverscanBorder(1,1) end end
any idea why it isn't working like i wanted? also, the background bug is anoying as well. ah yes, here the pic of how annoying it is:
that is before i change Draw() to Draw(HUD), Draw(ROOM), Draw(OBJECTS), Draw(SPRITES) which the background color become all orange.
any suggestions are welcomed!