Class Link
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public class Link : InteractiveUIElement, IUIElement
Constructors
|
Edit this page
View Source
Link(string, Vector2, Color, int, Font?)
Declaration
public Link(string text, Vector2 position, Color textColor, int fontSize = 16, Font? font = null)
Parameters
| Type |
Name |
Description |
| string |
text |
|
| Vector2 |
position |
|
| Color |
textColor |
|
| int |
fontSize |
|
| Font? |
font |
|
Properties
|
Edit this page
View Source
FocusHighlight
Declaration
public bool FocusHighlight { get; set; }
Property Value
|
Edit this page
View Source
FontSize
Declaration
public int FontSize { get; set; }
Property Value
|
Edit this page
View Source
Text
Declaration
public string Text { get; set; }
Property Value
|
Edit this page
View Source
TextColor
Declaration
public Color TextColor { get; set; }
Property Value
Methods
|
Edit this page
View Source
DrawSelf()
Override DrawSelf to handle label drawing
Derived classes should call base.DrawSelf() to ensure labels are drawn
Declaration
protected override void DrawSelf()
Overrides
|
Edit this page
View Source
InvokeClick()
Fire the click action (gamepad focus confirm).
Declaration
public void InvokeClick()
|
Edit this page
View Source
SetClickSound(IAudioSource)
Declaration
public void SetClickSound(IAudioSource sound)
Parameters
| Type |
Name |
Description |
| IAudioSource |
sound |
|
|
Edit this page
View Source
SetColors(Color, Color, Color)
Declaration
public void SetColors(Color normal, Color hover, Color pressed)
Parameters
| Type |
Name |
Description |
| Color |
normal |
|
| Color |
hover |
|
| Color |
pressed |
|
|
Edit this page
View Source
SetFont(Font)
Declaration
public void SetFont(Font font)
Parameters
| Type |
Name |
Description |
| Font |
font |
|
|
Edit this page
View Source
SetHoverSound(IAudioSource)
Declaration
public void SetHoverSound(IAudioSource sound)
Parameters
| Type |
Name |
Description |
| IAudioSource |
sound |
|
|
Edit this page
View Source
SetLocalizationKey(string, string?)
Sets the localization key for automatic text updates when language changes.
Declaration
public void SetLocalizationKey(string localizationKey, string? fallbackText = null)
Parameters
| Type |
Name |
Description |
| string |
localizationKey |
The localization key (e.g., "WISHLIST")
|
| string |
fallbackText |
Text to use if translation fails
|
|
Edit this page
View Source
SetLocalizationService(ILocalizationService?)
Sets the localization service to use for automatic font and text management.
Declaration
public override void SetLocalizationService(ILocalizationService? localizationService)
Parameters
Overrides
|
Edit this page
View Source
SetOnClick(Action)
Declaration
public void SetOnClick(Action action)
Parameters
| Type |
Name |
Description |
| Action |
action |
|
|
Edit this page
View Source
SetPosition(Vector2)
Declaration
public void SetPosition(Vector2 position)
Parameters
| Type |
Name |
Description |
| Vector2 |
position |
|
|
Edit this page
View Source
SetShowUnderline(bool)
Declaration
public void SetShowUnderline(bool showUnderline)
Parameters
| Type |
Name |
Description |
| bool |
showUnderline |
|
|
Edit this page
View Source
SetText(string)
Declaration
public void SetText(string text)
Parameters
| Type |
Name |
Description |
| string |
text |
|
|
Edit this page
View Source
SetTextProperties(int, Color)
Declaration
public void SetTextProperties(int fontSize, Color textColor)
Parameters
| Type |
Name |
Description |
| int |
fontSize |
|
| Color |
textColor |
|
|
Edit this page
View Source
UpdateSelf()
Override UpdateSelf to provide common interactive element functionality
Derived classes should call base.UpdateSelf() before their own update logic
Declaration
protected override void UpdateSelf()
Overrides
|
Edit this page
View Source
Updates the tooltip text from the localization service using the stored tooltip localization key.
Declaration
protected override void UpdateTooltipFromLocalization()
Overrides
Implements