FlatButton for sketchware

 Hey fellow coders,

Do you all are bored of using same boring button in sketchware again and again? Yes I know that in sketchware pro a new button material button is introduced but we can't customise it as we want. 


So Today I am presenting you customisable button. And guess what, it looks like the button we see in games. Below is the preview of that button.


And the good thing is you can customise it as you want. 

Library for this widget

To do this you need fbutton library. You can download it from this link.

After downloading when you'll open this zip file you'll get a folder named as fbutton_V_1.0.5 
Copy this file in sketchware library folder. ( .sketchware>libs>local_libs> )
Now refresh your file manager.

Enabling library
Now come back to sketchware create new project and enable fbutton library from local library option. 

Creating button
Add a simple button to your view area

When you touch on that button you'll see option menu in bottom. Click on convert option
And now you'll see Button written in text box, clear this and write info.hoang8f.widget.FButton in place of button. 

Oncreate event
In oncreate add a asd block and paste the following code



button1.setShadowEnabled(true);
button1.setShadowHeight(5);
button1.setCornerRadius(5);
Here button1 is I'd of your button and you can change it.

Import
Add import options and open it.
Add a import block in it and paste the code.
info.hoang8f.widget.FButton

Done! Now you can run the project.

Onclick event
There is no need of adding onclick event manually. You'll find it in your events section. You can configure it as you want. 


If you need project tell us in comments.

Comments

Popular posts from this blog

Sketchware Generate Firebase Dynamic Link (Long Url To Short) | sketchware blocks explained

what is sketchware and history of sketchware

How to import local library in sketchware

Create HTML Dialog in Sketchware

Create Percentage loading bar in sketchware

how to import export custom blocks sketchware

Sketchware Generate Firebase Dynamic Link (Long Url To Short) | sketchware blocks explained

Android 10/11 Storage Permission sketchware | New blocks + method

Auto Get text from camera || OCR in sketchware || free project | Sketchware pro tutorial

Image filter moreblocks for making black and white imageview