PhotoBox Class (RWE.GameOn.Core)



Represents an image.



  • src.ToString
    String – Sets the image location via string.
PhotoBox1.src.ToString = "C:\Location of Photo";
PhotoBox1.src.ToString = "/resources/image.png";
  • Enabled
    Boolean – Defines whether the UI Element is interact-able or not.
PhotoBox1.Enabled = false;
  • AutoSize
    Boolean – Defines whether the UI Element should be autosized.
PhotoBox1.AutoSize = true;
  • Height
    Variable – Defines the height of the UI Element.
PhotoBox1.Height = 32px;
  • Width
    Variable – Defines the width of the UI Element.
PhotoBox1.Width = 500px;
  • BorderStyle
    Variable – Sets the border style of the UI Element.
PhotoBox1.BorderStyle = Single;
  • BorderStyle.Colour
    Variable – Sets the border colour of the UI Element.
PhotoBox1.BorderStyle.Colour = ColourSpace.Red;
PhotoBox1.BorderStyle.Colour = new ColourSpace(HEX("#hexcode"));
PhotoBox1.BorderStyle.Colour = new ColourSpace(ARGB(RRR,GGG,BBB,ALPHA));
PhotoBox1.BorderStyle.Colour = new ColourSpace(ARGB(RRR,GGG,BBB,ALPHA));

//You can use .Color and ColorSpace too!
  • BorderStyle.Weight
    Variable – Sets the border weight of the UI Element.
PhotoBox1.BorderStyle.Weight = 1px;
  • BackColour
    Variable – Sets the background colour.
PhotoBox1.BackColour = ColourSpace.Red;
PhotoBox1.BackColour = new ColourSpace(HEX("#hexcode"));
PhotoBox1.BackColour = new ColourSpace(ARGB(RRR,GGG,BBB,ALPHA));
PhotoBox1.BackColour = new ColourSpace(ARGB(RRR,GGG,BBB,ALPHA));

//You can use .BackColor and ColorSpace too!
  • Anchor
    Variable – Anchors the UI Element relative to a side or multiple sides of the parent container.
PhotoBox1.Anchor = top, left;
PhotoBox1.Anchor = bottom, top;
PhotoBox1.Anchor = left;
  • Activity
    Clause – Creates a new activity when the UI Element is interacted with. By default, the interaction is OnClick.
PhotoBox1.Activity(new Activity) { //activities go here }

//OnClick (Defined)
PhotoBox1.Activity(new Activity, OnClick) { //activities go here }

PhotoBox1.Activity(new Activity, OnHover) { //activities go here }
      • Includes the following actions:
        • OnClick
        • OnHover
  • Visibility
    Variable – Determines whether the UI Element is visible or not.
PhotoBox1.Visibility = visible;
PhotoBox1.Visibility = invisible;



new PhotoBox = PhotoBox1();
        PhotoBox1.src.ToString = "/my-image.png"
        PhotoBox1.AutoSize = true;