Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dave Smith
    @davesmith00000
    Welcome!
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    woo! first!
    Dave Smith
    @davesmith00000
    Haha!
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    so I'm trying to draw a hitbox...
    I've got a render method for a player like
    def render = Seq(
        Graphic(32, 32, Material.Bitmap(HelloIndigo.playerAssetName))
          .moveTo(position.toPoint),
        Shape.Box(hitbox, Fill.Color(RGBA.Red), Stroke(5, RGBA.Red))
      )
    and that's used by the scene's present
    but I don't see a red box around the player
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    anecdotally one of my teammates does see the box, but another does not
    1 reply
    all on firefox
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    noooo, why is Shape.Box a square instead of a rectangle?
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    evidently image effects like tints don't work on windows either?
    so I guess it's all the openGL stuff
    Dave Smith
    @davesmith00000
    Morning @nrktkt:matrix.org - right I think we're on different timezones - I'll be as quick as I can replying (I know you've got 48 hours!) - if you want me to look at a repo somewhere I'm happy to.
    Browsers and platforms do vary. Indigo runs on WebGL 2.0 and adoption isn't uniform. If one person is seeing it and other isn't - it's almost certainly that. Quickest way to check:
    Open your JS console in your browser and look at the logs, Indigo will tell you which WebGL version it's decided to use.
    Another thing to do is to use indigoRun - assuming you have electron installed (npm install -g electron) because Electron uses Chrome, and Chromes WebGL 2.0 support is pretty consistent.
    Dave Smith
    @davesmith00000

    noooo, why is Shape.Box a square instead of a rectangle?

    Congratulations, as the first user of shapes in the wild, you've found the first embarrassing bug. 😭
    QA is hard...
    I have a partial workaround for you, a bit unsatisfying but scaling works:

    Shape.Box(Rectangle(50, 50, 50, 50), Fill.Color(RGBA.Red))
                .withRef(-25, -25)
                .scaleBy(1.0, 0.5)
    I say partially, looks like strokes aren't playing well with that.
    I can see what the bug is and I'm kicking myself that I didn't notice earlier...
    Dave Smith
    @davesmith00000
    I have some time this morning, I'll see if I can fix that bug for you.
    Dave Smith
    @davesmith00000
    Also worth noting that by default the reference point for a box or a circle is its centre. You can move it with a withRef(..) as I did above. I'm not yet clear on the wisdom of this decision.
    Dave Smith
    @davesmith00000
    Ok I have a fix for that, I'll try and cut a release shortly after I've done a bit more testing.
    image.png
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    indeed, I'm about to hit the hay in pacific time
    this is where I'm seeing issues most so far https://github.com/kag0/ld48/blob/main/game/src/ld48/models/Player.scala#L138, not a show stopper, but being able to draw rectangles for hitboxes while sprites are under development is pretty useful
    Dave Smith
    @davesmith00000
    Release is in flight
    I've checked out your game - nice! :)
    Ah you've improvised with a Polygon - good idea.
    Dave Smith
    @davesmith00000
    On the positive, I literally consolidated a whole bunch of stuff last night to make releasing easier - nothing like testing in production as they say.
    Dave Smith
    @davesmith00000
    Oh, I remembered something else about Firefox - we noticed that (for reasons I don't understand) sometimes Firefox has hardware acceleration disabled. So two things to check:
    1) You're running a reasonably recent Firefox
    2) Hardware acceleration is on.
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    That was the odd thing about the hardware acceleration, I would have expected it to be off on Linux and on on widows, not the other way around.
    Dave Smith
    @davesmith00000
    Agreed.
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    sounds like you talked to my teammate on discord, but seems like it's a windows issue rather than a firefox issue (same silent GL downgrade happens on chrome)
    Dave Smith
    @davesmith00000
    Yep, I've suggested a drastic solution. 😁
    It's probably just the my WebGL 2 detection code isn't right on Windows. I don't have a way to test it so it's entirely likely.
    Dave Smith
    @davesmith00000
    @nrktkt:matrix.org I've given this link to your friend to try if you want to. This version of Indigo won't try and do WebGL detection, it'll just use WebGL 2.0 or die trying. Drop the files in your ~/.ivy2/local/ directory. Or not, totally up to you. :)
    Nathan Fischer
    @nrktkt:matrix.org
    [m]
    I'll give that a go in a bit
    I'm working around something right now where overlap detection doesn't work on rectangles with negative sizes
    Dave Smith
    @davesmith00000
    I'm looking forward to the bug reports. 😬
    Dave Smith
    @davesmith00000
    Hi @nrktkt:matrix.org - I've opened this PR to fix the negative size issues if you're interested in having a look. No worries if you're busy. :)
    PurpleKingdomGames/indigo#142
    nrktkt
    @nrktkt:matrix.org
    [m]
    looks good, using absolute values on other parameters probably shores up some other unidentified bugs that might have been out there as well