2

is there a common method to select object on canvas and apply re-sizing and other transformations. not specified in individual drawing objects.

Kandy7
  • 95
  • 1
  • 2
  • 14
  • You have to apply the transformations on the Canvas, then draw the image again. It applies even for operations in which you want to toggle certain fx. – Rutwick Gangurde Jan 21 '13 at 05:17
  • i want a Generic Method for selection and transformations.i.e Boxes, Circles..etc. – Kandy7 Jan 21 '13 at 05:20
  • **guys help me regrading this.....** – Kandy7 Jan 21 '13 at 06:40
  • What do you want to select exactly? – Rutwick Gangurde Jan 21 '13 at 07:01
  • lets say i have drawn a circle and triangle. if i select circle and re size it that should not re size using a code piece in circle.js. after selecting a object there should be a common function for re sizing and other tranformations. – Kandy7 Jan 21 '13 at 07:42
  • As far as my experience goes with the Canvas, you can't select any objects individually inside the Canvas, cause there aren't any. It's just the pixels formation that you see, as everything you do on the Canvas, is pixel based. What can be done is draw a new Canvas for every transformation over the base Canvas, and select that for the corresponding transformation. Games built on Canvas do that as well. – Rutwick Gangurde Jan 21 '13 at 08:24
  • But you can try this solution: http://stackoverflow.com/questions/8905247/how-to-select-html5-canvas-shapes – Rutwick Gangurde Jan 21 '13 at 08:25

1 Answers1

1

I think this site may help u about what u r asking Here's test

Cathy
  • 377
  • 1
  • 4
  • 21