Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Image - add drawing of rect #70

Closed
flamendless opened this issue Dec 31, 2020 · 0 comments
Closed

Image - add drawing of rect #70

flamendless opened this issue Dec 31, 2020 · 0 comments

Comments

@flamendless
Copy link
Owner

Hi, it would be useful if drawing a rectangle is allowed in the Image API.

This would be useful for tilemap/spritesheet drawing and having an indicator (rect) in the current frame/index. Usage would be:

local spritesheet = love.graphics.newImage("player_walk_sheet.png")
Slab.Image("Spritesheet", {
  --basic drawing of the spritesheet
  Image = spritesheet,
  SubX = 0,
  SubY = 0,
  SubW = spritesheet:getWidth(),
  SubH = spritesheet:getHeight(),

  --add rectangle
  RectColor = {1, 0, 0, 1}, --rect border color as love.graphics.setColor(1, 0, 0, 1)
  RectLineWidth = 2, --same as love.graphics.setLineWidth(2)
  RectX = x_offset * frame_width,
  RectY = y_offset * frame_height,
  RectW = frame_width,
  RectH = frame_height,
})
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant