Is it better(performance wise) to use the display.newPolygon or create the polygon image in external software

It has been quite sometime since I have popped a question on the forum (Thank God).

After going through some hassle of creating art assets for my current project. I felt it’s better to go with a minimalist approach.

My question is since I’ll be using basic shapes with some stroke effect to it. Would it be better to create them in external software or use the display.newPolygon and create the object.

And I would also like to know if there a smart way you know to change the hue of the object(image) without using any filters. Ex (chaging the values in object:setFillColor() after running some calculation).

Thanks in advance

Is it better performance wise? Yes. Will you be able to notice it? Probably not.

Too early optimisation (or for many users, optimisation in general) can be a pitfall that could just as well be walked past. As long as you aren’t being overtly wasteful, I doubt you’ll see any difference performance wise either way.

My personal preference is to use rects, circles and polygons when possible instead of creating images for them. This way, they’ll always scale and look good regardless of the screen size. It’s also easier and faster to change parts of the assets, like the stroke width or colour in code than it is to always reopen the image in Photoshop, make the changes, save it and overwrite the old image. However, this is just my personal opinion. I’d suggest just going with what you feel most comfortable with.

I would think that using newPolygon would be the way to go as long as you don’t need concave objects or a lot of points. You avoid bloated bundle sizes by having to include images.

:setFillColor() should handle your most basic color needs. I don’t know why you would need any filters.

Rob

Thanks XeduR and Rob for your replies, Yea I am aware of the statement “Premature optimization is the root of all evil”. But I just felt I wanted to know which is better, so that this question wouldn’t bother me later. 

Hi Quitalizner.

I’ve attached a module for HSV colors. This is part of a color picker.

RGB_Hue () is what you would want, I think. When I made that, I wasn’t thinking of colors being on a wheel, as the hue effect does, but you can just divide the angle by 360. I obviously didn’t get around to documenting much of this, but maybe it’s not too hard to figure out.  :slight_smile:

Thanks a ton @StarCrunch, this is really amazing.

Is it better performance wise? Yes. Will you be able to notice it? Probably not.

Too early optimisation (or for many users, optimisation in general) can be a pitfall that could just as well be walked past. As long as you aren’t being overtly wasteful, I doubt you’ll see any difference performance wise either way.

My personal preference is to use rects, circles and polygons when possible instead of creating images for them. This way, they’ll always scale and look good regardless of the screen size. It’s also easier and faster to change parts of the assets, like the stroke width or colour in code than it is to always reopen the image in Photoshop, make the changes, save it and overwrite the old image. However, this is just my personal opinion. I’d suggest just going with what you feel most comfortable with.

I would think that using newPolygon would be the way to go as long as you don’t need concave objects or a lot of points. You avoid bloated bundle sizes by having to include images.

:setFillColor() should handle your most basic color needs. I don’t know why you would need any filters.

Rob

Thanks XeduR and Rob for your replies, Yea I am aware of the statement “Premature optimization is the root of all evil”. But I just felt I wanted to know which is better, so that this question wouldn’t bother me later. 

Hi Quitalizner.

I’ve attached a module for HSV colors. This is part of a color picker.

RGB_Hue () is what you would want, I think. When I made that, I wasn’t thinking of colors being on a wheel, as the hue effect does, but you can just divide the angle by 360. I obviously didn’t get around to documenting much of this, but maybe it’s not too hard to figure out.  :slight_smile:

Thanks a ton @StarCrunch, this is really amazing.