Set Theme demo ?

Hi @radamanthus,

Sorry, I need to correct that documentation on that (about the file being included in the sample project). In the meantime, you can locate the necessary files in the Widget 2.0 Github repository here, along with sample theme files.

https://github.com/coronalabs/framework-widgets

Hope this helps,

Brent

Hi Brent,

Thanks for that link, that’s very helpful.

I have a few questions on this link:

  1. This seems to be a public repo. Can I mention this in a Corona book I’m writing?

  2. If I include this repo in my Corona project, is it possible to override Widgets behaviour?

Thanks!

Hi @radamanthus,

Yes, to question #1, this is a public repo and it will remain so. We don’t have any intention to remove it or lock it. For question #2, you can use the open-source as your widget library, and implement your own changes to it.

Regards,

Brent

Hi Brent,

Echoing StephanieL’s request here.

The setTheme documentation says “See the  WidgetDemo  sample to see how a theme file is structured and can [be] used in a real app.”

I tried both the public release (1076) and a recent daily build (1101). For both, the included WidgetDemo in SampleCode did not include an example theme file. I vaguely remember reading a Widgets 1.0 example code that shows a custom theme. Can you point to us where we can get a sample custom theme file?

Thanks!

Hi @radamanthus,

Sorry, I need to correct that documentation on that (about the file being included in the sample project). In the meantime, you can locate the necessary files in the Widget 2.0 Github repository here, along with sample theme files.

https://github.com/coronalabs/framework-widgets

Hope this helps,

Brent

Hi Brent,

Thanks for that link, that’s very helpful.

I have a few questions on this link:

  1. This seems to be a public repo. Can I mention this in a Corona book I’m writing?

  2. If I include this repo in my Corona project, is it possible to override Widgets behaviour?

Thanks!

Hi @radamanthus,

Yes, to question #1, this is a public repo and it will remain so. We don’t have any intention to remove it or lock it. For question #2, you can use the open-source as your widget library, and implement your own changes to it.

Regards,

Brent

Hi to all,

@Sir Brent regarding with the Widget 2.0 Github repository, I downloaded it already. Thanks for that source and guide. I need some clarifications about this. If I would like to create a custom theme, the images in

" \widget_assets\graphics\TexturePacker\Android " (or iOS) folder are the things that I need to change?

Thanks in advance.

Hi @09.SemperFidelis,

Yes, that is basically correct. You can create individual images if you want, but if you’re changing an entire theme across many widgets, you probably want to use TexturePacker or SpriteHelper to create a full sheet of widget assets like this one:

https://github.com/coronalabs/framework-widgets/blob/master/widget_theme_android%402x.png

Also, if you go that route, you’ll need to modify the theme file, similar to this one, and use that as your theme configuration.

https://github.com/coronalabs/framework-widgets/blob/master/widget_theme_android.lua

Hope this helps,

Brent

Thanks a lot Brent! Yup. That really helps.

So, yeah, I’ve taken that route. I already created my spritesheet thanks to Texture Packer. But my problem is in the “widget_theme_name.lua”, should I change the sheetData into the name of the lua file produced by the TexturePacker?

Again, thanks! More power!

Hi @09.SemperFidelis,

Yes, you need to make sure that the sheet image and the data that TexturePacker is generating is recognized by the custom theme file. Is it not working for some reason?

Brent

Hello Brent,

Thanks a lot for the help. It worked. I did some tinkering and it worked perfectly!! Kudos!  :) 

Hi to all,

@Sir Brent regarding with the Widget 2.0 Github repository, I downloaded it already. Thanks for that source and guide. I need some clarifications about this. If I would like to create a custom theme, the images in

" \widget_assets\graphics\TexturePacker\Android " (or iOS) folder are the things that I need to change?

Thanks in advance.

Hi @09.SemperFidelis,

Yes, that is basically correct. You can create individual images if you want, but if you’re changing an entire theme across many widgets, you probably want to use TexturePacker or SpriteHelper to create a full sheet of widget assets like this one:

https://github.com/coronalabs/framework-widgets/blob/master/widget_theme_android%402x.png

Also, if you go that route, you’ll need to modify the theme file, similar to this one, and use that as your theme configuration.

https://github.com/coronalabs/framework-widgets/blob/master/widget_theme_android.lua

Hope this helps,

Brent

Thanks a lot Brent! Yup. That really helps.

So, yeah, I’ve taken that route. I already created my spritesheet thanks to Texture Packer. But my problem is in the “widget_theme_name.lua”, should I change the sheetData into the name of the lua file produced by the TexturePacker?

Again, thanks! More power!

Hi @09.SemperFidelis,

Yes, you need to make sure that the sheet image and the data that TexturePacker is generating is recognized by the custom theme file. Is it not working for some reason?

Brent

Hello Brent,

Thanks a lot for the help. It worked. I did some tinkering and it worked perfectly!! Kudos!  :)