Using Inkscape to generate input map sprites in Godot

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • I needed to auto-generate a bunch of SVGs for my keyboard input map sprites. Godot doesn't import text objects from SVGs so I had to find another way to make it work.
    That's when I remembered that Inkscape has a command line interface that lets you easily convert text to paths within the SVG.
    Inkscape: inkscape.org/
    Join my Discord: / discord
    Follow me on Mastodon: mastodon.socia...
    #Godot #GameDev #IndieDev #PixelArt #VectorArt

Комментарии • 22

  • @tarsyth3433
    @tarsyth3433 Год назад +1

    Amazing! Thank you for sharing this idea!

  • @sslaxx
    @sslaxx Год назад +3

    Such a useful tool, Inkscape.

    • @nathan_hoad
      @nathan_hoad  Год назад +1

      Haha yeah. I’ve been an Inkscape user for almost 20 years now and I still love it.

    • @sslaxx
      @sslaxx Год назад

      Remember Sodipodi all those years ago.

    • @nathan_hoad
      @nathan_hoad  Год назад +1

      Lol yep. There are still a few references in Inkscape to Sodipodi.

  • @harmony_hunnie
    @harmony_hunnie Год назад +1

    this is sick! im now realizing the usefulnesss of OS.execute()

    • @nathan_hoad
      @nathan_hoad  Год назад +1

      It can be handy for stuff like this but should still be used with caution.

  • @Netaction
    @Netaction Год назад

    I always like SVG manipulation but why didn't you simply write the text on the empty key on runtime? Like you would do with any other button?

    • @nathan_hoad
      @nathan_hoad  Год назад +2

      Having them as pre-rendered images means I don’t have to do anything special to use the image for whatever a mapped input is in my dialogue.

  • @MrEliptik
    @MrEliptik Год назад +2

    Too bad Godot's bbcode doesn't support dynamic textures and only path.. Otherwise you could just use a Viewport with a Label inside it to dynamically generate the letter.
    Also you don't explain why you need svg? Does it need to be? Otherwise you could use the technique I mentioned and save all the letters to an image, just as you're doing here but without using inkscape

    • @nathan_hoad
      @nathan_hoad  Год назад +2

      It doesn’t have to be SVG. I just have a general preference for SVG for my UI assets.

    • @catcactus1234
      @catcactus1234 Год назад

      Svgs are generally better for UI elements. They maintain their resolution at any size, which is very useful for accessibility and resizing. You could probably achieve a similar effect with using a high-res png, but using svg ensures your images will always be high res.

    • @carnifexx
      @carnifexx 6 месяцев назад

      ​@@catcactus1234 if i'm not mistaken the problem is that godot doesn't really support svg, it just creates a .png when svg is imported.
      so no, it won't always be high res, at least not natively.

  • @master_sweety
    @master_sweety Год назад

    Good afternoon, and how to use pictures in dialogues? As in the timecode 0:50

    • @nathan_hoad
      @nathan_hoad  Год назад

      You can use the [img] BBCode tag.

    • @master_sweety
      @master_sweety Год назад

      @@nathan_hoad [img=load(your picture)]?

    • @nathan_hoad
      @nathan_hoad  Год назад

      Something like [img]res://something.svg[/img]

    • @master_sweety
      @master_sweety Год назад

      @@nathan_hoad Thanks!

    • @master_sweety
      @master_sweety Год назад

      ​@@nathan_hoad How to change scale img in dialogue ?

  • @AgnisNeZvers
    @AgnisNeZvers Год назад +1

    That's a killer solution. Is it going to be available to the public?

    • @nathan_hoad
      @nathan_hoad  Год назад +2

      I was thinking about adding it to my Input Helper addon but it would need to be a bit more user friendly first.