Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Changing the font?

    Beginners
    8
    16
    813
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vinicity
      vinicity F @SteveZX81 last edited by

      @SteveZX81, that would be nice.
      Maybe other people have made custom fonts they want to share as well? *Looks around hopefully *

      1 Reply Last reply Reply Quote 0
      • vinicity
        vinicity F last edited by

        Getting some more fonts is actually high up on my wish list for future Fuze updates. Either more built-in fonts or if more fonts could be added as assets.
        Also, I would like to have bold, italic, and underline options for print and drawText.

        Please?

        1 Reply Last reply Reply Quote 0
        • Martin
          Martin Fuze Team last edited by Martin

          Currently the way to create custom fonts is to create a tiled image, add a tile for each character that you want in your font and then use draw routines to draw the relevent tile for the desired ascii character. It's actually pretty simple once you get the hang of it. Initially it obviously takes a while to draw the images but once you get going it's OK and of course you only need to draw the characters you actually want. Be sure to draw them in order though to make the drawing code simpler.

          Like @SteveZX81 says, I'm pretty sure there are already examples out there. I could put one together at some point too if people are still struggling.

          My game is called YASS and I'm pretty sure there is a share code for it in the long share code thread (maybe in it's own thread too). That has a custom font and the code to display it.

          AndyG1985 1 Reply Last reply Reply Quote 4
          • PB____
            PB____ last edited by

            In my solitaire game, I have written a function called init_fuzify(text, boxSize, margin) it creates an image of the text argument, using a fuze-style font (white capital letters with red squares, like the FUZE ARENA title on the forum). The boxSize is the size of the boxes in pixels, and the margin, the amount of pixels between the boxes. It returns an image that has the text printed on it. So if you where to call it for example as: init_fuzify("Fuze Arena", 65, 10) then it would return an image with the site logo (pixel values are rough estimates here, since it's only an example). It does use rounded corners for the first and last character of a word, for any word that has 2 characters or more. In case that's of any help...

            1 Reply Last reply Reply Quote 2
            • AndyG1985
              AndyG1985 @Martin last edited by

              @Martin I’m using your custom font coding from Y.A.S.S, hope that’s OK. Crediting you in the annotations of course! It’s brilliantly simple and it’s taught me a lot 😊

              1 Reply Last reply Reply Quote 1
              • Martin
                Martin Fuze Team last edited by

                Of course @AndyG1985 that’s the whole point of having such an open system.

                1 Reply Last reply Reply Quote 2
                • AndyG1985
                  AndyG1985 last edited by AndyG1985

                  I’m afraid I’ve hit a bit of a snag with this coding. Is there a way of starting a new line? The usual “text \n text” doesn’t work.

                  Edit: what it does do is create some spaces.

                  waldron 1 Reply Last reply Reply Quote 0
                  • waldron
                    waldron F @AndyG1985 last edited by waldron

                    @AndyG1985 if i understand you right pressing enter starts a new line.

                    text - " like this
                    maybe"

                    1 Reply Last reply Reply Quote 2
                    • AndyG1985
                      AndyG1985 last edited by

                      Strange, that doesn’t work for me. I’ll have a play and see if I can work it out :)

                      Gameboy 1 Reply Last reply Reply Quote 1
                      • Gameboy
                        Gameboy F @AndyG1985 last edited by

                        @AndyG1985 I assume you are using @martin 's code for the font. If you are just retype it e.g

                        x = 0
                        y = 0

                        printText(x, y, "this is line one")
                        printText(x, y+20, "this is line 2")

                        but use the actual function name and parameters as those were just an example

                        1 Reply Last reply Reply Quote 0
                        • Martin
                          Martin Fuze Team last edited by

                          My code was never written to take "\n" into account so yeah, I'm afraid if using mine, you'll have to split it up manually as per what @Gameboy is saying.

                          1 Reply Last reply Reply Quote 0
                          • AndyG1985
                            AndyG1985 last edited by

                            That’s what I suspected. Thanks a lot both, I’ll have a fiddle :)

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post