Skip to content

Commit

Permalink
GITBOOK-73: 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 Jan 14, 2024
1 parent 98c95cf commit f560b23
Show file tree
Hide file tree
Showing 25 changed files with 44 additions and 12 deletions.
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) (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) (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) (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) (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.
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 (2) (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 (2) (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 (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 (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.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/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ Gum Application (binaries): [files.flatredball.com/content/Tools/Gum/Gum.zip](ht

Gum Source Code: [https://www.github.com/vchelaru/Gum](https://www.github.com/vchelaru/Gum)

Note that Gum uses XNA so the XNA runtime must be installed here:
Note that the Gum tool requires XNA. if you are using the Gum tool, you must install the XNA runtime:

[https://www.microsoft.com/en-us/download/details.aspx?id=20914](https://www.microsoft.com/en-us/download/details.aspx?id=20914)
4 changes: 2 additions & 2 deletions docs/gum-elements/component/default-child-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This Component is designed to keep all of is children inside the InnerRectangle,

To make this kind of relationship the default, the Frame can set its Default Child Container property to InnerRectangle.

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

Once this value is set, instances which are drag+dropped onto Frame instances will use the InnerRectangle as their parent, as shown in the following animation.

Expand All @@ -28,4 +28,4 @@ When one instance is drag+dropped onto another instance, the Parent property is

Using the example above, the RectangleInstance is dropped on the ContainerTestInstance. Since the ContainerTestInstance is of type Frame, then the Default Child Container is applied on the drop, which results in the RectangleInstance's Parent being set to ContainerTestInstance.InnerRectangle.

<figure><img src="../../.gitbook/assets/image (2) (1).png" alt=""><figcaption></figcaption></figure>
<figure><img src="../../.gitbook/assets/image (2) (1) (1).png" alt=""><figcaption></figcaption></figure>
2 changes: 1 addition & 1 deletion docs/gum-elements/container/children-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Top to Bottom Stack results in each child being positioned after its previous si

Left to Right Stack results in each child being positioned after its previous sibling horizontally. This can be used to create vertical stacks quickly.

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

### Stacking and Units

Expand Down
2 changes: 1 addition & 1 deletion docs/gum-elements/container/stack-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Stack Spacing variable controls the additional padding between children when

A larger Stack Spacing value increases the spacing between each child. By default Stack Spacing is set to 0 which means that no spacing is added between items in a stack.

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

Changing the stack spacing adds gaps between each child as shown in the following animation.

Expand Down
2 changes: 1 addition & 1 deletion docs/gum-elements/general-properties/y-origin.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Baseline refers to the bottom of the text for letters without descenders. For mo

Baseline is often used to align fonts of different sizes. The following image shows two Text instances with different font sizes. Both are positioned by their baseline so their bottoms align properly (ignoring descenders, such as on the letter p and the comma).

<figure><img src="../../.gitbook/assets/image.png" alt=""><figcaption><p>50,000 xp aligned by baseline</p></figcaption></figure>
<figure><img src="../../.gitbook/assets/image (2).png" alt=""><figcaption><p>50,000 xp aligned by baseline</p></figcaption></figure>

By contrast, the following image shows the same Text instances using bottom alignment.&#x20;

Expand Down
4 changes: 2 additions & 2 deletions docs/gum-elements/nineslice/nineslice.texture-address.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The **Texture Address** variable can be used to define the area that the NineSli

The following screenshot shows an entire texture being used for a NineSlice.

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

The entire texture is split up into 3 sections horizontally and 3 sections vertically, matching up the texture coordinates used to display the NineSlice's 9 sections.

Expand All @@ -28,5 +28,5 @@ The NineSlice uses the following variables:

These values result in the the following NineSlice:

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

2 changes: 1 addition & 1 deletion docs/intro-tutorials/properties-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To see how this works, select the "Text" item under the "Standard" item. Notice

If the default Horizontal Alignment and Vertical Alignment values are changed, the changes will immediately be reflected in the preview window for the default Text configuration:

![](<../.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png>)
![](<../.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png>)

Now if we select the TextIntance we will see that the VerticalAlignment is visibly using the Bottom value; however the **Horizontal Alignment** is still using center - this is because a value that is explicitly set on an instance will always override the default value set in the Standard element. Notice that **Horizontal Alignment** is black (indicating a custom value) and **Vertical Alignment** is green (indicating a default value).

Expand Down
2 changes: 1 addition & 1 deletion docs/menu/project-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The Font Ranges setting controls which characters are included in default fonts.

The default Font Ranges value is `32-126,160-255` which maps to the first page of the Bitmap font generator character set, labeled as **Latin + Latin Supplement**.

![](<../.gitbook/assets/image (2) (1) (1) (1).png>)
![](<../.gitbook/assets/image (2) (1) (1) (1) (1).png>)

Various websites provide a list of unicode character sets such as [https://unicode-table.com/en/blocks/](https://unicode-table.com/en/blocks/)

Expand Down
2 changes: 1 addition & 1 deletion docs/monogame/loading-.gumx-gum-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To add the files to your .csproj:
3. Verify that all gum files (see the extension list above) are marked as Copy if newer in Visual Studio\


<figure><img src="../.gitbook/assets/image (1).png" alt=""><figcaption><p>Gum project set to Copy if newer</p></figcaption></figure>
<figure><img src="../.gitbook/assets/image (1) (1).png" alt=""><figcaption><p>Gum project set to Copy if newer</p></figcaption></figure>

### Loading a Gum projecxt

Expand Down
32 changes: 32 additions & 0 deletions docs/monogame/runtime-objects-guederiving/textruntime.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,35 @@ var textInstance = new TextRuntime();
textInstance.Text = "Hello world";
text.AddToManagers(SystemManagers.Default, null);
```

### Fonts

By default all TextRuntime instances us an Arial 18 pt font. This can be changed by specifying ta custom font.

Fonts on TextRuntime objects can be modified in one of two ways:

1. By setting the UseCustomFont property to true, then changing the CustomFontFile property to a desired .fnt file.
2. By setting UseCustomFont property to false, then changing the individual Font values. This approach requires following a specific .fnt naming convention.

For most projects, the first approach is recommended since it doesn't require specific naming conventions. The second approach is convenient if your project is using the Gum tool, and if the Gum tool has already generated fonts for the specific combinations of values you are assigning.

The following code shows how to load a custom font:

```csharp
var customText = new TextRuntime();
customText.UseCustomFont = true;
customText.CustomFontFile = "WhitePeaberryOutline/WhitePeaberryOutline.fnt";
customText.Text = "Hello, I am using a custom font";
container.Children.Add(customText);
```

This code assumes a font file named WhitePeaberryOutline.fnt is located in the `Content/WhitePeaberryOutline` folder. By default all Gum content loading is performed relative to the Content folder.

Note that .fnt files reference one or more image files, so the image file must also be added to the correct folder. In this case, the WhitePeaberryOutline.fnt file references a WhitePeaberryOutline.png file, so both files are in the same folder.

<figure><img src="../../.gitbook/assets/image.png" alt=""><figcaption><p>WhitePeaberryOutline font in the Solution Explorer</p></figcaption></figure>

Also, note that files are loaded from-file rather than using the content pipeline. This means that extensions (such as .fnt) are included in the file path, and that both the .fnt and .png files must have their **Copy to Output Directory** value set to **Copy if newer**.

<figure><img src="../../.gitbook/assets/image (1).png" alt=""><figcaption><p>Copy if newer property set</p></figcaption></figure>

2 changes: 1 addition & 1 deletion docs/monogame/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Note that as of the time of this writing, only MonoGame Desktop GL projects are
2. Add the `Gum.MonoGame` NuGet package\


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

### Initializing Gum

Expand Down

0 comments on commit f560b23

Please sign in to comment.