Jump to content

Multiple rectangles with resize controllers


Rexus
 Share

Recommended Posts

Hi,
I started playing around with PIXI.js and I want to create a simple Rectangle with controllers on the corners. After a mouse click on the rectangle it changes the color to orange and 4 of the controllers show up. The controllers allow to change size of the Rectangle. 

image.png.f121bad0943636f377444b1f34479b56.png

My first thought was to create my own abstract class Rectangle.
Class Product extends my Rectangle class.
I will add Product to entities list and draw all of them by PIXI.Graphics object.
Example: https://codesandbox.io/s/async-brook-ul1hh?file=/src/index.ts

Is it a good solution to solve that problem?
Should I use sprites if I want to draw +/- 2000 rectangles?
If yes what about losing quality after resizing?
Where should I add the controllers?

If any of you know how to solve this, please share with me your thoughts. Thank you very much in advance.

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...