Something that makes Corona incredible is that we offer more than 1,000 API calls to make your life as a designer simpler. This incorporates different accommodation APIs that make our easy to-utilize APIs significantly less complex.
In any case, once in a while those accommodation strategies can be to a lesser degree a comfort and all the more a cerebral pain when you attempt to utilize them past what they were intended for. How about we look at the widget. library for instance.
The widget.* library contains API’s to create buttons, switches, table Views and more, yet they were made with the expectation of copying the look and feel of iOS and Android UI components. Crown Labs in the long run added choices to change their look so they could be themed to accommodate your game or application better. The issue is attempting to topic these gadgets can be more mind boggling than building a custom gadget all alone. One of these gadgets is the widget. new Progress View.
In its most straightforward arrangement, the widget. new Progress View is very straightforward:
Furthermore, you get:
at the point when the advancement is set to half. It’s a basic iOS-like progressView. On the off chance that you change the gadget subject to Android, it will be progressively recognizable to local Android applications. However, consider the possibility that you need to accomplish something that accommodates your application better. Well you can utilize picture sheets to do that. How about we take a gander at the code first:
There is significantly more you need to do to set it up code savvy, yet what’s more you need to give a picture sheet that must be uncommonly developed. It’s a six casing, 64px X 64px per outline picture, where you have an external casing and an inward fill. Edges 1 and 3 speak to the end-tops of the external edge, outlines 4 and 6 speak to the fill of the end tops. Casing 2 is the external casing that is extended to fill the size you’ve set (width = 220 above) and casing 5 is the genuine advancement picture that will be extended to the rates the view is set to. Indeed, even with this current, it’s constrained. This picture sheet (disregard the foundation hues, they are there just to show you each edge):
will bring about an advancement View that resembles:
That edge and fill may not be what you need. Imagine a scenario in which you need to have something like a red to yellow to green inclination and maybe have a pointer that shows where in the red to green range you are. Well you can’t generally do that with this gadget. Why? Since the center casings stretch to the width and afterward the end tops are included.
Be that as it may, you can do this with one picture and one presentation. newRect() if its all the same to you square shapes, or a third picture to go about as a veil on the off chance that you need adjusted corners.
How about we take a gander at a model that will give you that inclination “temperature check”. Beginning with this picture and cover:
The picture will be the foundation of our advancement View and the cover will be utilized to give it adjusted corners. We will likewise utilize a showcase. newRect() and fill it with a naval force blue shading that will shut out the level of the angle that hasn’t been come to yet. At 75% advancement we ought to have something that resembles:
The code for this is very straightforward. How about we make a capacity to make another angle progress View and furthermore make a strategy to set the rate.