Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Drag draw sprite

New Here ,
Jun 24, 2008 Jun 24, 2008
I've had a search in the forums and I couldn't find an answer.

I need help with creating a draw tool which will draw shapes (rectangles, triangles, stars...) when selected. I am guessing that I just need to be able to click drag draw a sprite which contains the shapes?

There's an example of what I I'm talking about @ www.imagination3.com
If you go to Tools > Shapes you can see what I'm trying to emulate.

Someone on another forum suggested using Sprite.graphics.drawPolygon()
Does anyone have any working examples or code to work with.

Any help will be appreciated.
TOPICS
ActionScript
488
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2008 Jun 24, 2008
there's no drawPolygon() method in flash. it's easy enough to create one, but you'll need to do that yourself or use someone else's code.

how user's create a polygon in your application is up to use. a press and drag would be the most common way to do it.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 25, 2008 Jun 25, 2008
Thanks for the reply kglad.
Someone has kindly supplied their source file for a drawing app. This might be useful for others too.

quote:

I just created an actionscript 3 draw application, you can find the app and the source at my new blog http://www.urlvars.com/draw-app
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2008 Jun 25, 2008
LATEST
you're welcome.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines