Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Control descriptions #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
8 changes: 8 additions & 0 deletions docs/dev/controls/_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ If there are variations of the control available feel free to expand this sectio

---

## Parent Controls

Reference all inheritances here.

- <a href="/docs/dev/controls/control-control">Control</a>

---

## Available Parameters and Arguments

Describe here what parameters are available for this `Control`.
Expand Down
72 changes: 72 additions & 0 deletions docs/dev/controls/container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
id: control-container
title: Container
---

The `Container` control is the base for other controls.

*This documentation is a WIP and probably not exhaustive.*

---

## Usage Example

`Container` is an abstract class which provides base functionality for other controls.

---

## Parent Controls

- <a href="/docs/dev/controls/control-control">Control</a>

---

## Available Parameters and Arguments

**WidthSizingMode**
Type: *SizingMode*
Determines how the width of this container should be handled.
*(optional)*

**HeightSizingMode**
Type: *SizingMode*
Determines how the height of this container should be handled.
*(optional)*

**AutoSizePadding**
Type: *Point*
If `HeightSizingMode` or `WidthSizingMode` is set to `SizingMode.AutoSize`,
then `AutoSizePadding` is added to the size.
*(optional)*

---

## Available Methods

A list of `Methods` and `EventHandlers` to hook onto.

### Methods

**AddChild**
Adds a child to the control.

**RemoveChild**
Removes a child from the control.

**ClearChildren**
Removes all children from the control.

### EventHandler

**ChildAdded**

**ChildRemoved**

**ContentResized**

---

## Remarks

*This documentation is a WIP and probably not exhaustive.*

117 changes: 117 additions & 0 deletions docs/dev/controls/control.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
id: control-control
title: Control
---

The `Control` control is the base for all other controls.

*This documentation is a WIP and probably not exhaustive.*

---

## Usage Example

`Control` is an abstract class which provides base functionality for all other controls.

---

## Available Parameters and Arguments

**Size**
Type: *Point*
The size of the control. Both the X and Y component must be greater than 0.
*(optional)*

**Location**
Type: *Point*
The position of the control within its `Parent`.

**Parent**
Type: *Panel*
Parent control

**ContextMenuStrip**
Type: *ContextMenuStrip*
If provided, the menu will display when the control is right-clicked on.
*(optional)*

**Tooltip**
Type: *Tooltip*
If provided, the Tooltip will display when the mouse is over the control.
Do not use this if you are already using `BasicTooltipText`.
*(optional)*

**BasicTooltipText**
Type: *String*
If provided, a tooltip will be shown with the provided text when the mouse is over the control.
Do not use this if you are already using `Tooltip`.
*(optional)*

**Opacity**
Type: *Float*
Set an opacity level for the control.
*(optional)*

**Visible**
Type: *Bool*
Toggle visibility of the control.
*(optional)*

**Enabled**
Type: *Bool*
Toggle control.
*(optional)*

**Padding**
Type: *Thickness*
Set the control padding.
*(optional)*

**BackgroundColor**
Type: *Color*
Set the background color of the control.
*(optional)*

---

## Available Methods

A list of `Methods` and `EventHandlers` to hook onto.

### EventHandler

**Click**
Alias for `LeftMouseButtonReleased` with the difference that it only fires if `Enabled` is true.

**LeftMouseButtonPressed**

**LeftMouseButtonReleased**

**MouseMoved**

**RightMouseButtonPressed**

**RightMouseButtonReleased**

**MouseWheelScrolled**

**MouseEntered**

**MouseLeft**

**Shown**

**Hidden**

**Resized**

**Moved**

**Disposed**

---

## Remarks

*This documentation is a WIP and probably not exhaustive.*

34 changes: 16 additions & 18 deletions docs/dev/controls/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `Image` control adds a image asset to your layout.
This example shows how to use the `Image` control.

```cs
var exampleImage = new Image(Texture2D Icon)
var exampleImage = new Image(Texture2D Texture)
{
Size = new Point(40, 40),
Location = new Point(0, 0),
Expand All @@ -24,36 +24,34 @@ var exampleImage = new Image(Texture2D Icon)

---

## Available Parameters and Arguments
## Parent Controls

- <a href="/docs/dev/controls/control-control">Control</a>

---

**Size**
Type: *Point*
Size of the control *(optional)*
## Available Parameters and Arguments

**Location**
Type: *Point*
Position of the control within parent Panel
**Texture**
Type: *AsyncTexture2D*
Texture the control will show

**Parent**
Type: *Panel*
Parent Panel
**SpriteEffects**
Type: *SpriteEffects*
*(optional)*

**Tint**
Type: *Color*
Tint the control *(optional)*

**BasicTooltipText**
Type: *String*
Display a tooltip text on mouse hover *(optional)*
Apply a tint the control
*(optional)*

---

## Available Methods

A list of `Methods` and `EventHandlers` to hook onto.

**Click**
Call a method when clicking.
see parent controls

---

Expand Down
63 changes: 41 additions & 22 deletions docs/dev/controls/label.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,55 +27,74 @@ var exampleLabel = new Label()

---

## Available Parameters and Arguments
## Parent Controls

**Size**
Type: *Point*
Size of the control *(optional)*
- <a href="/docs/dev/controls/control-control">Control</a>
- <a href="/docs/dev/controls/control-labelbase">LabelBase</a>

**Location**
Type: *Point*
Position within parent panel
---

**Parent**
Type: *Panel*
Parent Panel
## Available Parameters and Arguments

**Text**
Type: *String*
The text this control will show
The text this control should show.

**Font**
Type: *BitmapFont*
The used font *(optional)*
The font the `Text` will be rendered in.
*(optional)*

**TextColor**
Type: *Color*
Color of the font *(optional)*
The color of the `Text`
*(optional)*

**HorizontalAlignment**
Type: *HorizontalAlignment*
The horizontal alignment of the text within the control.
Default: `Left`

**VerticalAlignment**
Type: *VerticalAlignment*
The vertical alignment of the text within the control.
Default: `Top`

**WrapText**
Type: *Bool*
Should text be wrapped when reaching the end of the control *(optional)*
Should text be wrapped when reaching the end of the control
Default: `true`

**ShowShadow**
Type: *Bool*
1px offset shadow will be applied behind the rendered text *(optional)*

**ShadowColor**
Type: *Color*
Color of the font *(optional)*
If enabled, a 1px offset shadow will be applied behind the rendered text.
Default: `true`

**StrokeText**
Type: *Bool*
A stroke effect will be applied to the text to make it more visible
If enabled, a stroke effect will be applied to the text to make it more visible.
`ShadowColor` will set the color of the stroke.

**ShadowColor**
Type: *Color*
If either `ShowShadow` or `StrokeText` is enabled, they will be drawn in this color.
*(optional)*

**AutoSizeWidth**
Type: *Bool*
Match the width of the text
If enabled, the `Control.Width` of this control will change to match the width of the text.

**AutoSizeHeight**
Type: *Bool*
Match the height of the text
If enabled, the `Control.Height` of this control will change to match the height of the text.

---

## Available Methods

A list of `Methods` and `EventHandlers` to hook onto.

see parent controls

---

Expand Down
Loading