[0.41] Bitmap drawing extension

yoplalala

  • *
  • Posts: 1632
New Bitmap drawing extension
version 0.41


You can now draw ellipses, circles, rectangles, round rectangles, polygons and curved lines on Images.

The only difference  with the normal draw is that you have now the option
draw: which draws the shape
fill : which fill with colour
both: which draws the shape and fill with colour
clear draw: which clears the outline
clear fill: which clears the 2d shape
clear both:  which clears both.

The rotation depends on the point of origin.

How much it clears depends ont the opacity ( or alpha) of the stroke/filling options.

version 0.4
[0.41]- two bugs corrected ( clear and rotation works with rectangles now) + blend mode for copy image on image
- plenty of drawing shapes blocks can now be rotated easily
- for plenty of drawing shapes choice of point of origin ( top left  and centre)
- copy a rotated image on another
- plenty of new shapes ( arcs, rings, wedges, polygons, etc) Courtesy of @ETHproductions

version 0.3
- clear options

version 0.2
- Colour the image
- add bezier line to polygon

To come features
-  Maybe more choices of point of origin
-  Maybe this http://blog.gskinner.com/archives/2008/05/drawing_curved_.html

Known Problems
-Not a great smoothing
- With HTML5 ( problems with polygons and bezier lines)
should be okay in the next openFL
https://github.com/openfl/openfl/issues/888
https://github.com/openfl/openfl/pull/911
- HTML5  clear doesn't work

Thanks @Liberado for correcting the little bugs :)





« Last Edit: January 14, 2016, 02:52:27 am by yoplalala »

LIBERADO

  • *
  • Posts: 2720
Excellent extension!

These new features are really very useful. I think this extension should be integrated into the Image API.

Thanks so much, @yoplalala
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

ajimundi

  • *
  • Posts: 230
This is excellent! I designed an algorithm with the Drawing extension only to realize that it doesn't draw on image. I was in the process of creating my own code, but now I won't have to.  :)
::: It's never too late, unless you're dead. Maybe not even then. :::

yoplalala

  • *
  • Posts: 1632
Bumping for new version

LIBERADO

  • *
  • Posts: 2720
Bumping for new version
More power! Downloading...

Thanks!

« Last Edit: October 06, 2015, 06:18:40 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

ajimundi

  • *
  • Posts: 230
Any reason you must keep the old version download link? This may lead to confusion.
::: It's never too late, unless you're dead. Maybe not even then. :::

designpeg

  • Posts: 731
Could you explain how you should use the 'add bezier line to polygon' block?

yoplalala

  • *
  • Posts: 1632
Quote
Thanks!
You're welcome :)

Quote
Any reason you must keep the old version download link? This may lead to confusion.

i'll remove it :)

Quote
Could you explain how you should use the 'add bezier line to polygon' block?

Everytime you add a point p to a polygon after you added the first one, it adds a straight line from p-1 to p .
Everytime you add a bezier line to polygon , it adds a curved line from p-1 to p (making a curve through the  controlpoint)

You have to have at least one point before using the bezier line

LIBERADO

  • *
  • Posts: 2720
To complete the functionality of this extension, It would be a good idea to add in all blocks the "clear" option.
It would be a useful feature. In fact, I need it for a new game I am making.


« Last Edit: October 06, 2015, 01:51:22 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

yoplalala

  • *
  • Posts: 1632
When you clear, do you want to clear the filling color size + the stroke colour size, or just the filling colour size ?

yoplalala

  • *
  • Posts: 1632
In fact I'll do clear stroke, and clear fill, and maybe clear both.

LIBERADO

  • *
  • Posts: 2720
I think that clearing  the filling colour size + the stroke colour size would be more pefect and would allow more possibilities than clearing the filling colour size only. If I ever want to clear only the filling colour size, I will set to zero the stroke size.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

LIBERADO

  • *
  • Posts: 2720
In fact I'll do clear stroke, and clear fill, and maybe clear both.
Thanks, this is a better solution.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

yoplalala

  • *
  • Posts: 1632
Bumped for new version

LIBERADO

  • *
  • Posts: 2720
Fantastic! I will test it in depth.

I need the new "clear" feature to easily make this kind of games: http://community.stencyl.com/index.php/topic,25079.msg248388.html#msg248388

 :) Thanks yoplalala!!!

« Last Edit: October 06, 2015, 01:14:30 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.