SebastianMtl

Make a grid

Recommended Posts

Hi,

I'm new to pixi and I want to create a grid with line ,

but I'm not find any tutorial to make this.

I'm working with JS and I need to make something a little interactive ,

Display a grid with squares in it and select them.

I make a codepen ( with fabricJS ) of the result a want with Pixi

https://codepen.io/sebastiancz/pen/dyYKXgN?editors=1001

Does someone here can help me ?

Share this post


Link to post
Share on other sites

hi , this is how to make interactive in pixijs.
https://pixijs.io/examples/#/interaction/interactivity.js

You have a lot of way to perform this easily, you will just need practice and debug.
I made you a demo here to help you to start.
Click on grid and look how basic math work with normalised values.
https://www.pixiplayground.com/#/edit/YV5hysTk8rU1DJh9qP67a
 

Hope this can help you !

Share this post


Link to post
Share on other sites

I've change the alpha of the square thanks,

I update my code pen.

Is it possible to click and select multiple square ?

I want to do something like on the picture.

 

Sr9hP.gif

Edited by SebastianMtl

Share this post


Link to post
Share on other sites

hum this will be more related to js and math algo.
May add a key listener with key `shift`

addEventListener("keydown"...

 

than , if shift: true, make a mouse hover with push selected id in a global array. (a pool) 

When release shift, if you have things in your pool, make them selected.

 

Edited by jonforum

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.