1. rude
  2. love

Issues

Issue #53 wontfix

Make Drawable Strings

Anonymous created an issue

Currently the print functions in love.graphics are the odd ones out, because other ways of drawing things on screen use a consistent interface, but the print functions have their own conventions. I suggest introducing a String type that is a Drawable too. (You could also call it GraphicsString if you wanted to.)

I think the Drawable hierarchy in SFML is quite all right. Here's a link to its documentation for a concrete example of what I'm after.

http://sfml-dev.org/documentation/1.6/classsf_1_1Drawable.htm

Comments (7)

  1. Bill Meltsner

    This would actually be a regression - 0.5.0 used love.graphics.draw to display strings, but we switched to love.graphics.print(f) in 0.6.0.

    I'm leaving it up to bartbes to determine the fate of this ticket, though.

  2. Bart van Strien

    And I'm not quite sure what the use of this would be, in most cases you treat your strings differently, they aren't static objects, for now I don't think this is of any use, in the future it might be interesting if we really want to get the most out of performance. (anjo, if you disagree, just reopen it)

  3. Bill Meltsner
    • removed assignee

    There are some optimizations if you're able to bake strings into a normal Drawable, I guess, but I doubt it's worth the added complexity and overhead (yet another Volatile to load/unload...).

    Though, this sort of thing is doable in 0.7.0 with Framebuffers, if you really want (render the text to the framebuffer and draw the framebuffer instead, or get ImageData and turn it into an Image, or...) so I'm leaving this closed.

  4. Luiji Maryo
    • changed status to open

    Setting the state of this to open may have been a bad move on my part, but I'm not fully sure how the whole "bug tracker" system works.

    It would be useful to have love.graphics.draw being able to render strings along with love.graphics.print(f). love.graphics.print(f) give features that aren't available in love.graphics.draw (i.e. printf's ability to center text), however love.graphics.draw is also useful. For an explanation, let's give a simple use case:

    I have an animations library that I wrote that switches between various frames, which may be anything that may be passed to love.graphics.draw. This feature was initially used so that both a single graphic and a quad could be used to render. The ability to pass a string to love.graphics.draw would allow for strings to be used as frames in the animation, furthermore leading to the ability to create animated strings in games. This would be the most useful for circulating text (text that changes every five or so seconds from something like "Programming by Luiji" to "Graphics by Crabmaster".

    Anyway, I should look a bit more into this "Framebuffer" thing everybody's talking about. However, it's going to take me awhile to get to that topic (unless of course I have a sudden speed-up in today's movement), so I am leaving this comment here.

    Thank you for your time.

  5. Log in to comment