Onerat Games
  • Home
  • Games
    • Elden: Path of the Forgotten
    • Outback
    • Itch.io
  • Learn
    • Onerat's C# Console Engine >
      • Getting Started
      • Scripting API >
        • GameObject
        • Rigidbody
        • Transfrom
        • Component
        • Input
        • Rect
        • Screen
        • Vector2
        • Console Engine Math
      • Lessions >
        • Lesson 1: Snake
        • Lesson 2: Particle Simulation
        • Lesson 3: Tetris
      • Donate
      • Download
  • Asset Store
Transform Class Documentation

Transform Class


Constructor

Transform(Vector2Int position): Constructs a new instance of the Transform class with the specified position.

Properties

  • position: The position of the object represented by a Vector2Int.
  • rotation: The rotation value of the object.

Methods

  • Move(Direction direction, int speed, bool ScreenWrap = false): Moves the object in the specified direction with the given speed.

Example Usage


// Create a new Transform
Vector2Int position = new Vector2Int(0, 0);
Transform transform = new Transform(position);

// Move the object
int speed = 5;
transform.Move(Direction.Right, speed);

// Retrieve the position
Vector2 currentPosition = transform.position;
  
Powered by Create your own unique website with customizable templates.
  • Home
  • Games
    • Elden: Path of the Forgotten
    • Outback
    • Itch.io
  • Learn
    • Onerat's C# Console Engine >
      • Getting Started
      • Scripting API >
        • GameObject
        • Rigidbody
        • Transfrom
        • Component
        • Input
        • Rect
        • Screen
        • Vector2
        • Console Engine Math
      • Lessions >
        • Lesson 1: Snake
        • Lesson 2: Particle Simulation
        • Lesson 3: Tetris
      • Donate
      • Download
  • Asset Store