Skip to content

Commit

Permalink
GITBOOK-438: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru authored and gitbook-bot committed Feb 11, 2025
1 parent 609dabc commit 4ab53a7
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 5 deletions.
Binary file added docs/.gitbook/assets/10_10 02 03.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/11_05 30 25.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1) (1) (1) (1) (2) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1) (1) (1) (1) (2).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1) (1) (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1) (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/gum-tool/gum-elements/container/contained-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Since this container should only ever contain instances of a Heart component, th

In this example, FlatRedBall respects the Contained Type variable and generates a generic list.

<figure><img src="../../../.gitbook/assets/image (1) (1) (1) (1) (2).png" alt=""><figcaption><p>ContainerRuntime can be generic in FlatRedBall, so it respects the Contained Type variable</p></figcaption></figure>
<figure><img src="../../../.gitbook/assets/image (1) (1) (1) (1) (2) (1).png" alt=""><figcaption><p>ContainerRuntime can be generic in FlatRedBall, so it respects the Contained Type variable</p></figcaption></figure>

As mentioned above, the implementation of this variable depends on the runtime you are using. If you are using a runtime which does not implement this feature and you would like to have it added, please create a GitHub issue or make a request in Discord.
18 changes: 18 additions & 0 deletions docs/gum-tool/gum-elements/general-properties/alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,21 @@
<figure><img src="../../../.gitbook/assets/image (172).png" alt=""><figcaption><p>Sprites with Alpha of 255, 200, 150, 100, 50, and 0</p></figcaption></figure>

An object's transparency is a combination of its `Alpha`, [Blend](blend.md), and its [Source File](../sprite/source-file.md). Skia elements may also have transparent portions due to their shape (such as [ColoredCircle](../skia-standard-elements/coloredcircle.md) and [RoundedRectangle](../skia-standard-elements/roundedrectangle/)) as well as [dropshadows](../skia-standard-elements/general-properties/has-dropshadow.md).

## Alpha and Children

By default the Alpha property affects the selected instance only - it does not cascade down to its children. For example, the following shows a parent white ColoredRectangle with a child blue ColoredRectangle. If the white ColoredRectangle's `Alpha` property changes, the BlueRectangle's opacity does not change.

<figure><img src="../../../.gitbook/assets/10_10 02 03.gif" alt=""><figcaption><p>Parent Alpha does not change child opacity</p></figcaption></figure>

A parent can affect its children's transparency if the parent is a container with `Is Render Target` set to true. For example, if the white rectangle is added to a Container, the Container can make its entire contents transparent.

<figure><img src="../../../.gitbook/assets/11_05 30 25.gif" alt=""><figcaption><p>Entire Container Alpha makes all children transparent</p></figcaption></figure>

Note that by setting Is Render Target to true, the entire container's Alpha can be adjusted rather rather than the alpha value cascading to each individual child. This Alpha value is used to control transparency _after_ all children have been drawn. We can see the difference between a partially-transparent Container and each child individually being made partially transparent by overlapping two children ColoredRectangles.

The rectangles on the left each have an `Alpha` value of `255`. These rectangles are in a Container `Is Render Target` set to true and an `Alpha` set to `128`.

The rectangles on the right each have an `Alpha` of `128`, so the red rectangle is visible behind the blue rectangle.

<figure><img src="../../../.gitbook/assets/image.png" alt=""><figcaption><p>Container Alpha on the left, individual Alpha on the right</p></figcaption></figure>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Skia standard elements must be explicitly added to gum projects. To add Skia sta

After clicking this option, Gum adds new standard elements.

<figure><img src="../../../.gitbook/assets/image (1) (1) (1) (1) (2) (1).png" alt=""><figcaption><p>Skia standard elements in Gum</p></figcaption></figure>
<figure><img src="../../../.gitbook/assets/image (1) (1) (1) (1) (2) (1) (1).png" alt=""><figcaption><p>Skia standard elements in Gum</p></figcaption></figure>

Once these Skia standard elements are added, they can be added to Screens and Components just like any other standard element.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Changing the Sweep Angle changes the length of the arc. If the value is negative

A sweep angle of 360 creates an arc that extends to a full circle. Values greater than 360 appear the same as if Sweep Angle is set to 360.

<figure><img src="../../../../.gitbook/assets/image (1) (1) (1) (1).png" alt=""><figcaption><p>Sweep Angle of 360</p></figcaption></figure>
<figure><img src="../../../../.gitbook/assets/image (1) (1) (1) (1) (2).png" alt=""><figcaption><p>Sweep Angle of 360</p></figcaption></figure>

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

RoundedRectangle is similar to a ColoredRectangle with the added functionality of supporting rounded corners.

<figure><img src="../../../../.gitbook/assets/image (1) (1).png" alt=""><figcaption><p>Default RoundedRectangle</p></figcaption></figure>
<figure><img src="../../../../.gitbook/assets/image (1) (1) (1).png" alt=""><figcaption><p>Default RoundedRectangle</p></figcaption></figure>

RoundedRectangles also support Skia properties such as Has Dropshadow, Is Filled, and Use Gradient. For more information and examples, see the Skia Standard Element [General Properties pages](../general-properties/).
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ States are a powerful way to create expressive groups of variables. Some UI elem

For example, consider a Button component which displays a button callout.

<figure><img src="../../../.gitbook/assets/image.png" alt=""><figcaption><p>Button with Y button callout. Credit Game UI Database <a href="https://www.gameuidatabase.com/gameData.php?id=36&#x26;autoload=975">https://www.gameuidatabase.com/gameData.php?id=36&#x26;autoload=975</a></p></figcaption></figure>
<figure><img src="../../../.gitbook/assets/image (1).png" alt=""><figcaption><p>Button with Y button callout. Credit Game UI Database <a href="https://www.gameuidatabase.com/gameData.php?id=36&#x26;autoload=975">https://www.gameuidatabase.com/gameData.php?id=36&#x26;autoload=975</a></p></figcaption></figure>

This button might be a standard Button with the following states:

Expand Down

0 comments on commit 4ab53a7

Please sign in to comment.