Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Is it better(performance wise) to use the display.newPolygon or create the polygon image in external software
Started by Quitalizner May 30 2019 08:58 AM

5 replies to this topic
minimalistic art style polygon tool groups containers

Best Answer StarCrunch , 30 May 2019 - 10:24 AM

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.  :)

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Quitalizner

[GLOBAL: userInfoPane.html]
Quitalizner
  • Enthusiast

  • 45 posts
  • Corona SDK

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

 

 



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 762 posts
  • Corona SDK

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.



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,788 posts
  • Enterprise

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



[TOPIC: post.html]
#4

Quitalizner

[GLOBAL: userInfoPane.html]
Quitalizner
  • Enthusiast

  • 45 posts
  • Corona SDK

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. 



[TOPIC: post.html]
#5

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 805 posts
  • Corona SDK

  Best Answer

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.  :)

Attached Files

  • Attached File  hsv.zip   2.49KB   7 downloads


[TOPIC: post.html]
#6

Quitalizner

[GLOBAL: userInfoPane.html]
Quitalizner
  • Enthusiast

  • 45 posts
  • Corona SDK

Thanks a ton @StarCrunch, this is really amazing.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: minimalistic art style, polygon tool, groups, containers