Add draw method for drawable types

Issue #571 wontfix
Minh Ngo
created an issue

Image:draw(...), Canvas:draw(...), etc. Would be a nice option for object oriented people.

Comments (2)

  1. hahawoo
    image:draw(100, 100), 100, 100)

    There's less text to read (assuming isn't shortened).

    Maybe it doesn't read so well in some ways though?, 255, 255), 100, 100)
    height = img:getHeight(), 100, 100), 100, 100), 255, 255)
    img:draw(100, 100)
    height = img:getHeight()
    image:draw(100, 100)
    this_is_an_image:draw(100, 100)

    Or maybe it does.

    I'd say this is similar to using Source methods instead of functions: #483

    While I think there should be only one way to draw objects/play Sources, I'm not sure which way is best...

    A consistency could be made which says "functions which pertain to a single LÖVE object and don't affect the global state are methods". If Drawables had draw methods instead of, and Source control functions were removed, I think this might be true.

    Or maybe even "functions which pertain to a single LÖVE object are methods"...

    font ='font.ttf', 12)

    Or maybe "functions which are conceptually about the object are methods"... maybe the screen is conceptually different from an Image, and whatever is playing through the speakers is conceptually different from a Source... this seems pretty clear for things like Image:getHeight, or ParticleSystem methods... maybe less clear for something like Font:getWrap...

    I have noooooo idea. :D

  2. Log in to comment