https://linen.dev logo
Join Discord
Powered by
# ceramic
  • g

    gifted-whale-78169

    08/08/2022, 9:39 PM
    didnt realize ceramic has the tools built in
  • g

    gifted-whale-78169

    08/08/2022, 9:41 PM
    same with images too, neat
  • b

    billowy-waiter-28954

    08/08/2022, 9:41 PM
    (type
    ceramic help font
    to get more info)
  • g

    gifted-whale-78169

    08/08/2022, 9:42 PM
    👍
  • g

    gifted-whale-78169

    08/08/2022, 9:44 PM
    there we go!
  • b

    billowy-waiter-28954

    08/08/2022, 9:49 PM
    It works?
  • g

    gifted-whale-78169

    08/08/2022, 9:49 PM
    yea, thanks for the help :)
  • g

    gifted-whale-78169

    08/09/2022, 2:12 AM
    how can i keep visuals in the same position after a window resize?
  • g

    gifted-whale-78169

    08/09/2022, 2:21 AM
    sort of like anchor a visual so that it stay in the same absolute place no matter the screen size
  • g

    gifted-whale-78169

    08/09/2022, 2:22 AM
    because right now i have a texts pos set to
    text.pos(10, 10)
    and it changes x and y after a resize
  • g

    gifted-whale-78169

    08/09/2022, 2:22 AM
    while i have another text thats pos is just
    text.pos(width * 0.5, height * 0.5)
    and its fine
  • g

    gifted-whale-78169

    08/09/2022, 2:28 AM
    i think i have to resize the scene to fit the window?
  • g

    gifted-whale-78169

    08/09/2022, 2:57 AM
    Copy code
    sceneText.content = "Main Menu";
            sceneText.pointSize = 15;
            sceneText.align = CENTER;
            sceneText.font = assets.font(Fonts.DAYDREAM);
            sceneText.pos(width * 0.1, height * 0.1);
            add(sceneText);
    this text position still changes if a screen resize occurs
  • f

    faint-toothbrush-51643

    08/09/2022, 3:09 AM
    by default, when the window/screen is resized, it just scales it up
  • f

    faint-toothbrush-51643

    08/09/2022, 3:11 AM
    so if it goes from 600 pixels to 1200 pixels, an object that was at position 10 will still be ostensibly at position 10, but actually at pixel 20 when all is said and done
  • f

    faint-toothbrush-51643

    08/09/2022, 3:12 AM
    you can change this with
    settings.scaling
    in Project.hx
  • g

    gifted-whale-78169

    08/09/2022, 3:25 AM
    i looked everywhere in the docs, the closest i came was this but it seemed unrelated to individual visuals
  • g

    gifted-whale-78169

    08/09/2022, 3:25 AM
    ill try it, thank you
  • g

    gifted-whale-78169

    08/09/2022, 3:26 AM
    it works with
    FIT_RESIZE
    thank you so much, ive been scouring the docs for hours lmao
  • g

    gifted-whale-78169

    08/09/2022, 3:26 AM
    i feel a little stupid for not at least trying this earlier when i looked at it
  • g

    gifted-whale-78169

    08/09/2022, 6:35 PM
    can the Input have more than one function connected to the
    onKeyDown
    event at once?
  • g

    gifted-whale-78169

    08/09/2022, 6:39 PM
    also is it possible to make a text's color a gradient?
  • b

    billowy-waiter-28954

    08/09/2022, 7:39 PM
    yes, you just bind multiple functions:
    Copy code
    haxe
    input.onKeyDown(this, key -> {
        // handler 1
    });
    
    input.onKeyDown(this, key -> {
        // handler 2
    });
  • b

    billowy-waiter-28954

    08/09/2022, 7:41 PM
    Not out of the box. You could do it using a shader though, but that's less trivial if you are not comfortable with shaders
  • g

    gifted-whale-78169

    08/09/2022, 8:09 PM
    good to know, thank you
  • f

    faint-toothbrush-51643

    08/09/2022, 11:58 PM
    shaders aren't that difficult, i don't think, but i've never done them on text
  • f

    faint-toothbrush-51643

    08/09/2022, 11:59 PM
    i'm not entirely clear on how ceramic's text works, like it has separate quads for each glyph?
  • f

    faint-toothbrush-51643

    08/10/2022, 12:00 AM
    also, another thing to consider is to use, like, actual images for letters instead of using normal text
  • f

    faint-toothbrush-51643

    08/10/2022, 12:00 AM
    and line them up yourself
  • g

    gifted-whale-78169

    08/10/2022, 12:00 AM
    i have a
    MenuOptions
    class that extends
    Visual
    , but the two texts that are children of
    MenuOptions
    dont stay in the center of the screen after a resize, why?
12345...124Latest