I tried widget.newSpinner(), it works of course.
But if the background is black, it does not show up.
Is it possible to run the spinner in black background?
I tried widget.newSpinner(), it works of course.
But if the background is black, it does not show up.
Is it possible to run the spinner in black background?
Hi @joe16,
The spinner is, by default, “opaque black”. To display it on a black background, you’ll need to change the visual style of it. This method is outlined in the following tutorial. You’ll just need to create one new image (or you can create several for a more fancy spinner, if you desire).
http://www.coronalabs.com/blog/2013/07/16/tutorial-stylizing-widgets-part-1/
Take care,
Brent Sorrentino
Hi @joe16,
The spinner is, by default, “opaque black”. To display it on a black background, you’ll need to change the visual style of it. This method is outlined in the following tutorial. You’ll just need to create one new image (or you can create several for a more fancy spinner, if you desire).
http://www.coronalabs.com/blog/2013/07/16/tutorial-stylizing-widgets-part-1/
Take care,
Brent Sorrentino
Brent,
Is there an image sheet that you guys have already built for the default one that we can use to just invert the colors on in Photoshop?
Hi @thegdog,
I’ve put the spinner image on Dropbox. Can you download this and invert it in Photoshop?
https://www.dropbox.com/s/u1smued5fxnq96l/spinner_spinner.png
Best regards,
Brent
Thanks, Brent. I grabbed it and will try it tomorrow.
Assuming that I can use the default spinner values here to get this rendering as expected:
https://github.com/coronalabs/framework-widgets/blob/master/widget_theme_ios.lua
If not, will play with it and see what I come up with.
Appreciate you getting that for me. The one I made I wasn’t thrilled with.
Brent,
This worked great. Thanks again.
joe528 (and anyone else who needs it),
Here is the new image:
https://dl.dropboxusercontent.com/u/37778165/spinner_spinner.png
And here is the code for it:
lightSpinnerOptions = { width = 80, height = 80, numFrames = 1, sheetContentWidth = 80, sheetContentHeight = 80 } spinnerSingleSheet = graphics.newImageSheet( "Assets/spinner\_spinner.png", lightSpinnerOptions ) myLightSpinner = widget.newSpinner { width = 80, height = 80, sheet = spinnerSingleSheet, deltaAngle = 30, incrementEvery = 50, top = display.contentCenterY - 40, left = display.contentCenterX - 40 } myLightSpinner:start()
Hope that helps.
I have one more question about this image sheet, kind of off-topic though:
There is only one image in there, how does the widget make it animated?
How to implement it without using widget.newSpinner ?
It rotates the image so that the pieces move seamlessly, giving the appearance of the color fade being animated.
I guess you could create a theme, but you would still need to use widget.newSpinner. Why wouldn’t you want to use newSpinner?
@thedog, ok, I see, thanks.
I am using newSpinner, but I was just wondering how it is implemented.
There were good blog posts about the new widgets. If you search on the site, or just look through the blog page, you will find it. It explains more about how the Spinner widget works and how you can theme it.
Brent,
Is there an image sheet that you guys have already built for the default one that we can use to just invert the colors on in Photoshop?
Hi @thegdog,
I’ve put the spinner image on Dropbox. Can you download this and invert it in Photoshop?
https://www.dropbox.com/s/u1smued5fxnq96l/spinner_spinner.png
Best regards,
Brent
Thanks, Brent. I grabbed it and will try it tomorrow.
Assuming that I can use the default spinner values here to get this rendering as expected:
https://github.com/coronalabs/framework-widgets/blob/master/widget_theme_ios.lua
If not, will play with it and see what I come up with.
Appreciate you getting that for me. The one I made I wasn’t thrilled with.
Brent,
This worked great. Thanks again.
joe528 (and anyone else who needs it),
Here is the new image:
https://dl.dropboxusercontent.com/u/37778165/spinner_spinner.png
And here is the code for it:
lightSpinnerOptions = { width = 80, height = 80, numFrames = 1, sheetContentWidth = 80, sheetContentHeight = 80 } spinnerSingleSheet = graphics.newImageSheet( "Assets/spinner\_spinner.png", lightSpinnerOptions ) myLightSpinner = widget.newSpinner { width = 80, height = 80, sheet = spinnerSingleSheet, deltaAngle = 30, incrementEvery = 50, top = display.contentCenterY - 40, left = display.contentCenterX - 40 } myLightSpinner:start()
Hope that helps.
I have one more question about this image sheet, kind of off-topic though:
There is only one image in there, how does the widget make it animated?
How to implement it without using widget.newSpinner ?
It rotates the image so that the pieces move seamlessly, giving the appearance of the color fade being animated.
I guess you could create a theme, but you would still need to use widget.newSpinner. Why wouldn’t you want to use newSpinner?
@thedog, ok, I see, thanks.
I am using newSpinner, but I was just wondering how it is implemented.