Skip to content

RoofTool

Extends: Tool < Object

Description

The tool used to edit the roofs.

Accessed by Global.Editor.Tools["RoofTool"].

Properties

int Mode
int Sorting
int Type
Texture Texture
Range Width
bool Shade
Range SunDirection
Range ShadeContrast
Vector2 boxBegin
Vector2 boxEnd
bool isDrawing
Roof activeRoof

Methods

void SetShade ( bool value )
void UpdateSunlight ( float value )
void FinishShape ( )
void DrawRect ( Rect2 rect )

Property Descriptions

  • int Mode:
    The mode of the tool. 0 = Quickbox, 1 = Manual.

  • int Sorting:
    Where the next roof will be sorted. Underlying type is an enum. 0 = Over, 1 = Under.

  • int Type:
    Gets or sets the next type of roof created. Underlying type is an enum. 0 = Gable, 1 = Hip, and 2 = Dormer.

  • Texture Texture:
    Gets or sets the next roof's texture/style.

  • Range Width:
    The Range control that sets the width of the next roof.

  • bool Shade:
    Toggles if all roofs will be shaded according to sunlight. Call SetShade() as well.

  • Range SunDirection:
    The Range control that sets the direction the sun shines.

  • Range ShadeContrast:
    The Range control that sets the intensity of the sunlight.

  • Vector2 boxBegin:
    Start coordinates of the box that a user drags.

  • Vector2 boxEnd:
    End coordinates of the box that a user drags.

  • bool isDrawing:
    Whether the user is actively drawing.

  • Roof activeRoof:
    The reference to the current Roof being placed.

Method Descriptions

  • void SetShade ( bool value ):
    Toggles if all roofs will be shaded according to sunlight and also update the sunlight.

  • void UpdateSunlight ( float value ):
    Toggles if all roofs will be shaded according to sunlight and also update the sunlight.

  • void FinishShape ( ):
    Takes the polyline from WorldUI and turns it into a Roof and adds it into the Roofs children. Used by Manual mode.

  • void DrawRect ( Rect2 rect ):
    Creates a new roof using the rect parameter instead of . Used by Quickbox mode.