Class PortalSpaceComponent

Inheritance Relationships

Base Types

Class Documentation

class PortalSpaceComponent : public csp::multiplayer::ComponentBase, public csp::multiplayer::IEnableableComponent, public csp::multiplayer::IPositionComponent

Add a portal to your space that can be used to teleport users to another configured Space.

To ensure the connection to the new space is successful, clients should use the following steps:

  1. Store the new space Id by calling PortalSpaceComponent::GetSpaceId()

  2. Exit the current space via the space system.

  3. Enter the new one (also via the space system).

Public Functions

PortalSpaceComponent(SpaceEntity *Parent)

Constructs the portal space component, and associates it with the specified Parent space entity.

Parameters

Parent – The Space entity that owns this component.

const csp::common::String &GetSpaceId() const

Retrieves the space ID that this portal points to.

Note

When the user uses the portal, it should be able to leave the current space and enter the one identified by this function.

Returns

The ID of the space the portal component leads the player to.

void SetSpaceId(const csp::common::String &Value)

Sets the space ID that this portal points to.

Note

When the user uses the portal, it should be able to leave the current space and enter the one identified by this function.

Parameters

Value – The ID of the space the portal component leads the player to.

float GetRadius() const

Gets the radius of this portal.

Returns

The radius of this portal.

void SetRadius(float Value)

Sets the radius of this portal.

Parameters

Value – The radius of this portal.

void GetSpaceThumbnail(csp::systems::UriResultCallback Callback) const

Retrieves the space thumbnail information associated with the space.

If the space does not have a thumbnail associated with it the result callback will be successful, the HTTP res code will be ResponseNotFound and the Uri field inside the UriResult will be empty.

Parameters

Callback – UriResultCallback : callback when asynchronous task finishes