msw-ai-tf/maplestory-worlds-creator-docs huggingface dataset:
AlignmentType

Indicates the anchor's reference point.

# Members

[{"Name":"Center","Value":"0","Desc":"The reference position is the center of the parent."},{"Name":"Left","Value":"1","Desc":"The reference position is the left center of the parent."},{"Name":"Right","Value":"2","Desc":"The reference position is the right center of the parent."},{"Name":"TopCenter","Value":"3","Desc":"The reference position is the top center of the parent."},{"Name":"TopLeft","Value":"4","Desc":"The reference position is the left top of the parent."},{"Name":"TopRight","Value":"5","Desc":"The reference position is the right top of the parent."},{"Name":"BottomCenter","Value":"6","Desc":"The reference position is the bottom center of the parent."},{"Name":"BottomLeft","Value":"7","Desc":"The reference position is the left bottom of the parent."},{"Name":"BottomRight","Value":"8","Desc":"The reference position is the right bottom of the parent."},{"Name":"HorizontalTop","Value":"9","Desc":"The reference position is the top. The width will increase with the width of the parent."},{"Name":"HorizontalCenter","Value":"10","Desc":"The reference position is the center. The width will increase with the width of the parent."},{"Name":"HorizontalBottom","Value":"11","Desc":"The reference position is the bottom. The width will increase with the width of the parent."},{"Name":"VerticalLeft","Value":"12","Desc":"The reference position is the left. The height increases with the parent's height."},{"Name":"VerticalCenter","Value":"13","Desc":"The reference position is the center. The height increases with the parent's height."},{"Name":"VerticalRight","Value":"14","Desc":"The reference position is the right. The height increases with the parent's height."},{"Name":"StretchAll","Value":"15","Desc":"The width and height are stretched to the same size as the parent."}]

# Methods

[{"index":"AlignmentType CastFrom(number value) (Static)","0":"Converts numbers to the applicable type."}]

[{"index":"AlignmentType CastFrom(string value) (Static)","0":"Converts strings to the applicable type."}]
YoutubePlayerCommonComponent

Provides a function to play YouTube videos. This is a parent component of YoutubePlayerWorldComponent and YoutubePlayerGUIComponent.

# Properties

[{"index":"boolean Loop","0":"Sets whether to repeat playback of the video."}]

[{"index":"boolean PlayOnAwake","0":"Sets whether to play the video on starting the world."}]

[{"index":"float PlaySpeed (Sync)","0":"Sets up the play speed of videos. You can use values between 0.5 and 3."}]

[{"index":"boolean Shuffle","0":"Sets whether to shuffle playback order of the videos saved in Urls when a value is true."}]

[{"index":"List Urls","0":"Specifies video URLs."}]

[{"index":"float Volume (Sync)","0":"Sets the volume level. You can use values between 0 and 1."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

[{"index":"void ClearScreen(string targetUserId = nil) (Client)","0":"Stops video playback and clears the screen."}]

[{"index":"void Jump(int32 timeInSeconds, string targetUserId = nil) (Client)","0":"Move the play point to a specific time and then play. The unit of time is the second in an integer."}]

[{"index":"void Pause(string targetUserId = nil) (Client)","0":"Pauses video playback."}]

[{"index":"void Play(string targetUserId = nil) (Client)","0":"Replays all videos from the beginning."}]

[{"index":"void PlayPause(string targetUserId = nil) (Client)","0":"Stops or plays paused video."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]
Naming Entities

# Course Introduction

One of the most effective ways to distinguish objects is to name them. Names can be used to classify objects, NPCs, and users. Here's how to use NameTagComponent and some examples.

# Naming

Select an entity, and add NameTagComponent. You can change the property value to make a name tag. [png](1633505174925b7f918183b8d46d996e32b3e84b3c15d)

The property composition of NameTagComponent is as follows.

[{"Name":"FontColor","Description":"Change the color of the letters. For more info on changing colors, refer to Sprite Color Adjustment."},{"Name":"FontSize","Description":"Change the name tag's name and size; the default is 1. The bigger the value, the bigger the tag."},{"Name":"Name","Description":"Change the name of the name tag. The default value is Null, and you can name it whatever you'd like."},{"Name":"NameTagRUID","Description":"You can use various Name Tag Sprites.[png](1682065127446a1289f492f38401abbff1b9f791dbd13)"},{"Name":"OffsetY","Description":"Choose the location of the name tag; the starting point is 0, and the axis is set to Y by default. If the value is 0, the name tag will be put on the starting point. A negative number will move the tag downwards, and a positive number will move it upwards."}]

# Utilizing Name Tags

The example shows you how to put a name tag on an object to use it as an NPC. If you'd like to use a monster or NPC from the same Sprite, you can use a name tag to distinguish them. For example, you can place multiple cat objects and put a cat NPC with a name tag among them as the boss.

You can practice by entering the following value:

  * FontColor: f5e38b
  * FontSize: 1
  * Name: Lost Cat
  * NameTagRUID: ac88638649c3479bbb754e4b34bb3eac
  * OffsetY: 0



[jpg](1656464315991005b3cae5aef4145a89c2fb8338abe15)
JoystickComponent

A Component to support the key function for virtual operation controlling the player's movement in the mobile environment.

# Properties

[{"index":"AxisType Axis","0":"Sets the axis type for the operation key to move."}]

[{"index":"KeyboardKey DownArrow","0":"Pushing the controller down triggers this key."}]

[{"index":"boolean DynamicStick","0":"The location of the control key moves to the user's touched location during play."}]

[{"index":"KeyboardKey LeftArrow","0":"Pushing the controller left triggers this key."}]

[{"index":"KeyboardKey RightArrow","0":"Pushing the controller right triggers this key."}]

[{"index":"KeyboardKey UpArrow","0":"Pushing the controller up triggers this key."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Examples

This is an example of mapping the joystick’s downward position to the E key input. Movement is processed in the client space, so the key should also be changed in the client.
    
    
    @Component
    script JoystickMappingTrigger extends Component
        @ExecSpace("ClientOnly")
        method void SetJoystickDownArrow()
        local joystick = _EntityService:GetEntityByPath("/ui/DefaultGroup/UIJoystick")
        joystick.JoystickComponent.DownArrow = KeyboardKey.E
        end
    
        @ExecSpace("ClientOnly")
        @EventSender("Self")
        handler HandleTriggerEnterEvent(TriggerEnterEvent event)
        -- Parameters
        local TriggerBodyEntity = event.TriggerBodyEntity
        --------------------------------------------------------
        self:SetJoystickDownArrow()
        end
    end
    

# SeeAlso

  * TriggerEnterEvent
  * EntityService
PulleyJointComponent

Create and delete PulleyJoint. Two connected rigid bodies move like a pulley.

# Properties

[{"index":"SyncList Joints (Sync) (ReadOnly)","0":"Set Joint information."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

[{"index":"int32 AddJoint(Entity targetEntity, Vector2 localAnchorA, Vector2 localAnchorB, Vector2 groundAnchorA, Vector2 groundAnchorB, float ratio = 1)","0":"Add Joint. Return index on success, -1 on failure."}]

[{"index":"void DestroyJoint(int32 index)","0":"Removes the Joint whose sequence number corresponds to the index."}]

[{"index":"int32 GetJointsCount()","0":"Returns the number of joints."}]

[{"index":"void SetCollideConnected(int32 index, boolean collideConnected)","0":"Set the CollideConnected value of the Joint whose sequence number corresponds to index."}]

[{"index":"void SetLocalAnchorA(int32 index, Vector2 localAnchorA)","0":"Set the LocalAnchorB value of the Joint whose sequence number corresponds to index."}]

[{"index":"void SetLocalAnchorB(int32 index, Vector2 localAnchorB)","0":"Set the LocalAnchorB value of the Joint whose sequence number corresponds to index."}]

[{"index":"void SetRatio(int32 index, float ratio)","0":"Set the Ratio value of the Joint whose sequence number corresponds to index."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# SeeAlso

  * [Applying Physics to Entities ](/docs?postId=761)
  * [Using Physics](/docs?postId=757)
  * [Using Various Physics Joints](/docs?postId=760)
Sprite

The class contains meta information (e.g., pivot, border, etc.), which is to express the image of the MSW, and the texture binary of the image.

# Properties

[{"index":"Vector4 Border (ReadOnly)","0":"This is the boundary value used when rendering the Sprite using the Sliced method in the UI."}]

[{"index":"RectOffset Collision (ReadOnly)","0":"This is an aabb box representing the collision range."}]

[{"index":"ReadOnlyList> Footholds (ReadOnly)","0":"The convex information constitutes a footing on which an entity can stand."}]

[{"index":"int32 Height (ReadOnly)","0":"The height of the sprite."}]

[{"index":"Vector2Int OffsetInTexture (ReadOnly)","0":"For sprites included in the atlas, the value records the position and size of the atlas texture."}]

[{"index":"Vector2 Pivot (ReadOnly)","0":"This is the center point when placing the sprite into the world."}]

[{"index":"Vector2Int PivotPixel (ReadOnly)","0":"This is the center point when placing the sprite into the world. The value is expressed in pixels of the Pivot."}]

[{"index":"float PixelPerUnit (ReadOnly)","0":"The size in pixels corresponding to 1 Unit of the grid scale."}]

[{"index":"int32 Width (ReadOnly)","0":"The width of the sprite."}]

##### inherited from ResourceObject:

[{"index":"boolean IsLoadComplete (ReadOnly)","0":"A flag to check whether the resource has successfully loaded. All resources in MSW can be used only after loading is completed."}]

[{"index":"string RUID (ReadOnly)","0":"The RUID of the resource."}]

[{"index":"ResourceType Type (ReadOnly)","0":"The type of the resource."}]

# Methods

[{"index":"Sprite LoadAndWait() (Deprecated) (Yield)","0":"This function is deprecated. Use the LoadSpriteAndWait(string) function of ResourceService."}]

[{"index":"Sprite Get(string RUID) (Deprecated) (Static)","0":"This function is deprecated. Use the LoadSpriteAndWait(string) function of ResourceService."}]

[{"index":"void LoadAsync(string RUID, func loadCompleteCallback) (Deprecated) (Static)","0":"This function is deprecated. Use the LoadSpriteAndWait(string) function of ResourceService."}]
UIBaseParticleComponent

The parent component of the UIParticleComponent, which creates the particle effect used in UI.

# Properties

[{"index":"boolean AutoRandomSeed","0":"Sets whether to create a new random seed whenever particle emission begins."}]

[{"index":"Color Color","0":"Corrects the color of the particles to be rendered."}]

[{"index":"boolean IsEmitting (ReadOnly) (HideFromInspector)","0":"Indicates whether new particles are being emitted."}]

[{"index":"Vector2 LocalScale","0":"This indicates particle size."}]

[{"index":"boolean Loop","0":"Sets whether the particle will play on repeat."}]

[{"index":"float ParticleCount","0":"Set the number of particles."}]

[{"index":"float ParticleLifeTime","0":"Set the particle duration."}]

[{"index":"float ParticleSize","0":"Set the particle size."}]

[{"index":"float ParticleSpeed","0":"Set the particle speed."}]

[{"index":"boolean PlayOnEnable","0":"Set whether to play particles when the particle component is set to Enable."}]

[{"index":"float PlaySpeed","0":"Set the play speed of particles."}]

[{"index":"boolean Prewarm","0":"If set to Enable, the maximum number of particles is loaded, and the particles play naturally."}]

[{"index":"integer RandomSeed","0":"Sets the random seed used to determine creation position, emission direction, speed, etc. when particle is played."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

[{"index":"void Play() (ClientOnly)","0":"Play stopped particles."}]

[{"index":"void Stop() (ClientOnly)","0":"Stops the particle from playing."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]
MaterialService

The service controls the properties of the material.

# Methods

[{"index":"void ChangeMaterialProperty(string entryId, Dictionary changeProperty) (ClientOnly)","0":"Changes the material property's corresponding entryId. changeProperty's key is the property name. value is the property's value."}]

##### inherited from Service:

[{"index":"EventHandlerBase ConnectEvent(string key, IScriptFunction eventHandler)","0":"Links events. When a key-type event occurs in this service, a handler is notified. The handler receives event parameters."}]

[{"index":"EventHandlerBase ConnectEvent(Type eventType, IScriptFunction eventHandler)","0":"Links events. This service notifies a handler when an eventType event occurs. The handler receives event parameters."}]

[{"index":"boolean DisconnectEvent(string key, EventHandlerBase eventHandler)","0":"Disconnects the event with the key-type event and the handler."}]

[{"index":"boolean DisconnectEvent(Type eventType, EventHandlerBase eventHandler)","0":"Disconnects the eventType event from its handler."}]

[{"index":"void SendEvent(EventType sendEvent)","0":"Generates an event."}]

# Examples

This is an example of implementing a lighting effect that follows the player. The TestMaterial uses a vigette shader. Change the CenterPos property of TestMaterial. For the example to work correctly, the active CameraComponent must use TestMaterial.
    
    
    @Component
    script PlayerScreenMaterialUpdater extends Component
        property string materialId = ""
    
        @ExecSpace("ClientOnly")
        method void OnBeginPlay()
        self.materialId = _EntryService:GetMaterialIdByName("TestMaterial")
        end
    
        @ExecSpace("ClientOnly")
        method void OnUpdate(number delta)
        local playerWorldPosition = _UserService.LocalPlayer.TransformComponent.WorldPosition
    
        local targetScreenPos = _UILogic:WorldToScreenPosition(Vector2(playerWorldPosition.x, playerWorldPosition.y))
        targetScreenPos.x = targetScreenPos.x / _UILogic.ScreenWidth
        targetScreenPos.y = targetScreenPos.y / _UILogic.ScreenHeight
    
        local options = {["CenterPos"] = targetScreenPos}
    
        _MaterialService:ChangeMaterialProperty(self.materialId, options)
        end
    end
    

# SeeAlso

  * UILogic
  * EntryService
  * UserService
  * [Designing Materials](/docs?postId=828)
  * [Implementing Materials](/docs?postId=950)
Quaternion

The quaternion used to represent the rotation value.

# Properties

[{"index":"float w","0":"The w value of the quaternion."}]

[{"index":"float x","0":"The x value of the quaternion."}]

[{"index":"float y","0":"The y value of the quaternion."}]

[{"index":"float z","0":"The z value of the quaternion."}]

# Constructors

[{"index":"Quaternion(float x, float y, float z, float w)","0":"Initializes Quaternion to the specified value."}]

# Methods

[{"index":"float Angle(Quaternion b)","0":"Finds the angle between two quaternions. Returns a value between 0 and 180."}]

[{"index":"Quaternion Clone()","0":"Generates a copy."}]

[{"index":"float Dot(Quaternion b)","0":"Finds the inner product of two quaternions."}]

[{"index":"Quaternion Normalize()","0":"Finds a Quaternion of size 1."}]

[{"index":"float Angle(Quaternion a, Quaternion b) (Static)","0":"Finds the angle between two quaternions. Returns a value between 0 and 180."}]

[{"index":"float Dot(Quaternion a, Quaternion b) (Static)","0":"Finds the inner product of two quaternions."}]

[{"index":"Quaternion Euler(Vector3 euler) (Static)","0":"Converts Euler angles into Quaternions."}]

[{"index":"Quaternion Normalize(Quaternion q) (Static)","0":"Finds a Quaternion of size 1."}]

# Operators

[{"index":"boolean Equality(Quaternion left, Quaternion right) (Static)","0":"Checks if two quaternions indicate identical rotation. Returns true when the rotation is identical. Otherwise, returns false. For accurate comparison, two quaternions must be in a normalized state."}]

[{"index":"boolean Inequality(Quaternion left, Quaternion right) (Static)","0":"Checks if two quaternions indicate different rotation. Returns false when the rotation is identical. Otherwise, returns true. For accurate comparison, two quaternions must be in a normalized state."}]

[{"index":"Quaternion Multiply(Quaternion left, Quaternion right) (Static)","0":"Creates a new Quaternion entity by multiplying two quaternions."}]

[{"index":"Vector3 Multiply(Quaternion left, Vector3 right) (Static)","0":"Returns a new Vector3 entity by rotating a vector."}]
PolygonRendererComponent

This feature allows you to draw polygons.

# Properties

[{"index":"Color Color (Sync)","0":"The color of the polygon."}]

[{"index":"boolean IgnoreMapLayerCheck (Sync)","0":"Does not perform automatic substitution when the Map Layer's name is specified in SortingLayer."}]

[{"index":"string MaterialId (Sync)","0":"Specifies the Id of the material that will be used at the renderer."}]

[{"index":"int32 OrderInLayer (Sync)","0":"Determines the priority within the same layer. A higher number indicates higher priority."}]

[{"index":"SyncList Points (Sync)","0":"The group of dots that form a polygon."}]

[{"index":"string SortingLayer (Sync)","0":"When two or more Entities overlap, the priority is determined according to the Sorting Layer."}]

[{"index":"boolean UseCustomUVs (Sync)","0":"If true, the UV value ​​set in the UVs is applied to the shape."}]

[{"index":"SyncList UVs (Sync)","0":"Sets the vertex's UV. It must have the same length as Points."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

[{"index":"void ChangeMaterial(string materialId)","0":"Replace the material to be applied to the renderer."}]

[{"index":"boolean IsDrawable()","0":"Connect dots saved in Points property to see if they make up a polygon. The polygon will not be completed if any lines cross with one another."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Events

[{"index":"OrderInLayerChangedEvent","0":"This event occurs when changing the Component's OrderInLayer."}]

[{"index":"SortingLayerChangedEvent","0":"This event occurs when changing the component's SortingLayer."}]

# SeeAlso

  * [Draw Polygon](/docs?postId=1080)
NameTagComponent

Displays the Entity's name tag and set-related information.

# Properties

[{"index":"boolean Bold (Sync)","0":"Sets whether to use bold text."}]

[{"index":"Color FontColor (Sync)","0":"Changes the text color."}]

[{"index":"Vector2 FontOffset (Sync)","0":"Adjusts position of the text within the name tag."}]

[{"index":"float FontSize (Sync)","0":"Sets the font size."}]

[{"index":"string Name (Sync)","0":"Sets the name on the name tag."}]

[{"index":"DataRef NameTagRUID","0":"You can change the name tag shape."}]

[{"index":"float OffsetY (Sync)","0":"Sets Offset of the name tag's position."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Examples

This is an example of changing the NameTag to prevent users from knowing each other's nicknames. UserId is used to determine the word and color of the NamgTag when a user enters.
    
    
    @Component
    script UserRoleNametagSetter extends Component
        @ExecSpace("ServerOnly")
        @EventSender("Service", "UserService")
        handler HandleUserEnterEvent(UserEnterEvent event)
        -- Parameters
        local UserId = event.UserId
        --------------------------------------------------------
    
        local userEntity = _UserService:GetUserEntityByUserId(UserId)
        local nametag = userEntity.NameTagComponent
    
        if UserId == "000000" then
        	nametag.Name = "Admin"
        	nametag.FontColor = Color.magenta
        else
        	nametag.Name = "Player"
        	nametag.FontColor = Color.cyan
        end
        end
    end
    

# SeeAlso

  * UserEnterEvent
  * UserService
  * [Naming Entities](/docs?postId=29)