Write a short description
It is only for making a Component Transparent.
Add a picture of all the blocks
Write instructions to use your extension
Component
- Input your Component.
Value
- set your transparent value between 0.1 - 1.0 with f
as it is a float
value
Include a Download link here; can be direct or a link to your website/host
aryan.gupta.SetOpacity.aix (4.9 KB)
5 Likes
why that extension name, same as this extension?
[FREE] GestureDetect
"NavigationTool"
first i create all the 3 extension in one extension and then extract them to 3 extensions.
the image is from the Navigation when i have created them in one.
TIMAI2
November 28, 2020, 9:30am
6
Thank you for this extension. You may consider doing more work on the value a developer needs to add. For example set the range of values to 1 - 10, and then inside the extension handle the conversion to 0.1 - 1.0 and add the f ?
1 Like
TIMAI2
November 28, 2020, 11:03am
8
It is fairly trivial using javascript, what is the problem in java ?
(here I use blocks....)
you can do this in blocky but in java , you will get a error that String cannot be converted to float
TIMAI2
November 28, 2020, 11:08am
10
Doesn't make sense. Your extension is feeding java a string....?
1 Like
do you have setup Appinventor sources in your pc ?
if yes, then i will give you my source code then, you can easily try it
in blocky you can join a String with a Integer but in java you can't do that
but you can use String.parseFloat()
method to get the float from the string.this extension is also using this method.
1 Like
TIMAI2
November 28, 2020, 11:26am
14
You have the toString() method in java as well
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
1 Like
but setAlpha()
is only use float. and float with f
TIMAI2
November 28, 2020, 11:32am
16
Hopefully, someone with more java/extension experience than me will be able to advise....
yes, i have also many doubts while creating this extension
TIMAI2
November 28, 2020, 11:54am
18
Tested your extension.
Actually it accepts 0f (which makes totally transparent). Therefore the range is 0 - 1.
A value less than 0 will work and be equal to 0 (e.g. -0.5f)
A value greater than 1 will work and be equal to 1 (e.g. 1.5f)
Also works with decimals larger than 1, e.g. 0.657f works and is less transparent than 0.6f or 0.65f
This is all useful for very specific levels of transparency, conditional checking, "fuzzy logic" and a looser application of values.
2 Likes
Can I ask the obvious question - why use a text block for input instead of a math block?
why everyone asking me this question ?