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

    shy-motherboard-37327

    01/28/2023, 12:43 AM
    I'm porting something ive done in haxeflixel (and also have tried porting to some other engines to get a feel for them) In this specific case Im just creating the graphical presentation of a unit in a TBS. So a "base" and an animated sprite combined
  • s

    shy-motherboard-37327

    01/28/2023, 12:44 AM
    Works fine either way - but in this case I dont need to use a component
  • s

    shy-motherboard-37327

    01/28/2023, 12:44 AM
    Copy code
    haxe
    class UnitIcon extends Visual {
        public var base:Sprite;
        public var sprite:Sprite;
    
        public function new(unit:UnitData) {
            super();
    
            anchor(.5, .5);
    
            base = new Sprite();
            base.sheet = MainScene.iconSheet;
            base.quad.roundTranslation = 1;
            base.animation = "unit_base";
            base.quad.color = 0x778899FF;
            base.anchor(.5, .5);
    
            sprite = new Sprite();
            sprite.sheet = MainScene.unitSheet;
            sprite.quad.roundTranslation = 1;
            sprite.animation = "infantry_idle";
            sprite.anchor(.5, .5);
    
            add(base);
            add(sprite);
        }
    }
  • s

    shy-motherboard-37327

    01/28/2023, 12:45 AM
    (obviously just a poc)
  • s

    shy-motherboard-37327

    01/28/2023, 12:53 AM
    Autocompletion seems to be painfully slow
  • f

    fresh-finland-97755

    01/28/2023, 4:33 AM
    Yeah I had the same issue when I was playing around with ceramic a few months ago.
  • g

    gifted-whale-78169

    01/28/2023, 5:26 AM
    my implementation of differently sized pipes is taking one texture and randomly making copies of it, but they seem to be clipping. how can i make them look like just one image?
  • g

    gifted-whale-78169

    01/28/2023, 5:27 AM
    (notice the lines on the base of the pipe)
  • g

    gifted-whale-78169

    01/28/2023, 5:33 AM
    i was thinking about adding a pool for the pipes, but it seems like extra work since the pipes are random sizes each time so i just manage it through an array and
    .destroy()
    it when necessary
  • f

    faint-toothbrush-51643

    01/28/2023, 5:38 AM
    what are you using to lengthen them?
  • b

    billowy-waiter-28954

    01/28/2023, 8:45 AM
    Yes, that’s something I hope will be improved in future haxe versions…
  • g

    gifted-whale-78169

    01/28/2023, 4:49 PM
    a loop that makes copies of a texture based on a randomly generated number, and then the textures are placed at the end of the previous texture
  • g

    gifted-whale-78169

    01/28/2023, 4:49 PM
    I'll send code when I can
  • s

    shy-motherboard-37327

    01/28/2023, 8:56 PM
    why cant you just scale in the Y and attach an end piece
  • f

    faint-toothbrush-51643

    01/28/2023, 9:18 PM
    that seems weird
  • f

    faint-toothbrush-51643

    01/28/2023, 9:18 PM
    you're copying the texture itself or adding more quads?
  • g

    gifted-whale-78169

    01/28/2023, 10:26 PM
    adding more quads that have the same texture
  • g

    gifted-whale-78169

    01/28/2023, 10:26 PM
    i would but i plan on changing the texture and i think it would make it look stretched
  • f

    faint-toothbrush-51643

    01/28/2023, 10:28 PM
    understandable
  • f

    faint-toothbrush-51643

    01/28/2023, 10:28 PM
    not sure why the gaps though
  • f

    faint-toothbrush-51643

    01/28/2023, 10:28 PM
    i did something very similar and i don't think i got any gaps
  • f

    faint-toothbrush-51643

    01/28/2023, 10:29 PM
    can you share the code?
  • g

    gifted-whale-78169

    01/28/2023, 10:29 PM
    oh yea i forgot here you go
    Copy code
    haxe
    for (i in 0...tailLength) {
                var q = new Quad();
                q.texture = tailtex;
                q.pos(width/2, height/2 - i * tailtex.height); //TODO1 remove spaces between pipe tails
                q.anchor(0.5, 1);
                tail.push(q);
            }
  • g

    gifted-whale-78169

    01/28/2023, 10:29 PM
    this is in
    class Pipe extends ceramic.Visual {}
  • f

    faint-toothbrush-51643

    01/28/2023, 10:36 PM
    hm
  • f

    faint-toothbrush-51643

    01/28/2023, 10:37 PM
    try making sure that the pipes' positions are always integers
  • f

    faint-toothbrush-51643

    01/28/2023, 10:38 PM
    this could be a result of anti-aliasing
  • b

    billowy-waiter-28954

    01/28/2023, 10:38 PM
    Could also set
    texture.filter = NEAREST
  • g

    gifted-whale-78169

    01/28/2023, 10:39 PM
    ill try both
  • f

    faint-toothbrush-51643

    01/28/2023, 10:40 PM
    forgot about that
1...505152...124Latest