Discord
Login
Community
DARK THEME

Sprite not drawing

code:

init = function()
  x=10
  y=10
end

update = function()
end

draw = function()
  screen.drawMap("map1",0,0, screen.width, screen.height)
  screen.drawSprite("icon",120,-4)
 
end

map drowing but sprite hero is not why ?

You seem to have omitted the fourth parameter which is the width of the sprite ; just try:

screen.drawSprite("icon",120,-4,50)

Omitting an argument is like passing zero thus your sprite was being drawn with a null size.

The fifth parameter is the height you want the sprite to be drawn at. This one can be omitted, it will then be computed given the provided width and the original ratio of the sprite.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community