[FREE] SetOpacity - Make your Component Transparent

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)


why that extension name, same as this extension?
[FREE] GestureDetect


Now, check @Anke

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.

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

have a look at this ??

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

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

You have the toString() method in java as well

1 Like

but setAlpha() is only use float. and float with f

Hopefully, someone with more java/extension experience than me will be able to advise....

yes, i have also many doubts while creating this extension

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.


Can I ask the obvious question - why use a text block for input instead of a math block?

why everyone asking me this question ?