Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Gradient as Image Sheet?
Started by d.mach Jul 04 2017 12:38 PM

3 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 908 posts
  • Corona SDK

I want to create an image using display.newRect and then add a gradient to it and then use this created image as an image sheet... is this possible somehow? Or can image sheets only be images stored in the directory?

 

Creating different gradients on the fly and then use them as image sheets (to cut them into a lot of small pieces) would make things easier for me :)

 

Is this possible?

 

Alternate question: If not... is it possible to add a gradient to an image sheet somehow before cutting the image apart?



[TOPIC: post.html]
#2

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 821 posts
  • Corona SDK

You're basically asking for a canvas. As far as I know this works with image sheets, though I don't have a working example on hand.



[TOPIC: post.html]
#3

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 908 posts
  • Corona SDK

Thank you for your help with this. The basic idea behind doing it like this is to have no images at all to keep the app as small as possible.



[TOPIC: post.html]
#4

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,120 posts
  • Corona SDK

I think I read your post wrong....

 

So how about creating a rect at 2048 x 2048 px, apply a gradient fill and the save that as a png.  You could then load that as an imagesheet and do with it what you want?

 

That way you are creating the image (say on first run) and it is not stored in the apk.




[topic_controls]
[/topic_controls]