Pixi.js: Sprite Follow Mouse Pointer

Поделиться
HTML-код
  • Опубликовано: 27 сен 2024

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

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

    Problem with PixiJS is the documentation, i must dig deep into the sprite API to finds out how the coordinate system is implemented

  • @sk3ptik0s49
    @sk3ptik0s49 3 года назад

    Awesome, kind of what I was gonna try.

  • @olexklym4132
    @olexklym4132 4 года назад +4

    Thanks!
    I get error "has been blocked by CORS policy:"
    After installing openserver and run like website it is gone;
    Perfect.

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

      How can i install openserver??

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

    really appreciate this. Amazing tutorial series!
    One question regarding intetellisese. My VSCode intellisense does'nt seem to recognize the PIXI commands. How did you get yours to work with PIXI?
    Cheers and keep up the good work!

  • @NinjaSagaAwsomness
    @NinjaSagaAwsomness 7 месяцев назад

    my player doesn't move when mouse pointer gets outside it's bounds.

  • @dmmd5329
    @dmmd5329 4 года назад +1

    Cool, thank you

  • @AlanDanielx
    @AlanDanielx 3 года назад

    PIXI.Applpication is not a constructor

    • @sk3ptik0s49
      @sk3ptik0s49 3 года назад

      ()

    • @Travis.Pirozzini
      @Travis.Pirozzini 2 года назад +9

      let player = PIXI.Sprite.from("images/player.png");
      drop the "new" and it will work. I'm using version 7.

  • @jw-nv6uu
    @jw-nv6uu 7 месяцев назад

    app.stage.hitArea = app.screen
    to get it to work without dropping the object

  • @westbrma
    @westbrma 11 месяцев назад

    So I noticed a bit of lag, you can reduce this a by forcing a render when the mouse moves using app.render() otherwise I believe this happens during the next animation tick

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

    would you mind if you share src code

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

    It's now for some reason doesn't pass event further moving object itself. Only works above yellow brick for me.
    version 7
    Found out that it happens because now you can really interact with stage itself properly and you gotta use window events or use another layer like background with might be invisible and the size of your canvas.
    like this:
    const bg = PIXI.Sprite.from(PIXI.Texture.WHITE);
    bg.width = app.view.width;
    bg.height = app.view.height;
    bg.opacity = 0
    app.stage.addChild(bg);
    bg.anchor.set(0.5)
    bg.x = app.view.width / 2
    bg.y = app.view.height / 2
    bg.interactive = true
    bg.on(`pointermove`, movePlayer)

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

      There are some big changes in 7. I've not had a chance to review them myself, so I'll need to update these videos for the changes. I hope to be able to get to this soon.

  • @timdouglas2011
    @timdouglas2011 4 года назад

    I'm getting loads of errors...I imagine it's because I'm using Pixi V5 though 🤔

    • @olexklym4132
      @olexklym4132 4 года назад +1

      install any server and run like website