# Game
# Description
The Game namespace provides functionality to access game state, information, and environment variables. Through this namespace, you can obtain important data such as game time, map information, mouse cursor position, and more.
# How to Use
#include "Noble.h"
void OnGameUpdate()
{
// Get the current game time
float currentTime = Game::Time();
// Get the mouse cursor position
Vector cursorPos = Game::CursorPos();
// Check if the chat box is open
bool isChatOpen = Game::IsChatOpen();
Console::Add("Game time: %.2f, Mouse position: (%.0f, %.0f)",
currentTime, cursorPos.X, cursorPos.Z);
}
# CameraLock
void Game::CameraLock(bool v)
Sets the camera lock state.
Parameter Name | Parameter Type | Description |
---|---|---|
v | bool | Whether to lock the camera |
// Lock the camera
Game::CameraLock(true);
// Unlock the camera
Game::CameraLock(false);
# CursorPos
Vector const& Game::CursorPos()
Gets the mouse cursor position in the game world.
Vector cursorPos = Game::CursorPos();
Console::Add("Mouse position: X=%.1f, Y=%.1f, Z=%.1f", cursorPos.X, cursorPos.Y, cursorPos.Z);
# GameID
std::uint64_t Game::GameID()
Gets the unique identifier for the current game.
std::uint64_t gameId = Game::GameID();
Console::Add("Game ID: %llu", gameId);
# GameTimeTickCount
int Game::GameTimeTickCount()
Gets the tick count of the game time.
int ticks = Game::GameTimeTickCount();
Console::Add("Game time tick count: %d", ticks);
# IsCameraLock
bool Game::IsCameraLock()
Checks if the camera is locked.
bool isLocked = Game::IsCameraLock();
Console::Add("Camera lock status: %s", isLocked ? "Locked" : "Unlocked");
# IsChatOpen
bool Game::IsChatOpen()
Checks if the game chat box is open.
bool chatOpen = Game::IsChatOpen();
Console::Add("Chat box status: %s", chatOpen ? "Open" : "Closed");
# MapID
eGameMapID Game::MapID()
Gets the ID of the current game map.
eGameMapID mapId = Game::MapID();
const char* mapName = "Unknown";
switch (mapId)
{
case eGameMapID::SummonersRift:
mapName = "Summoner's Rift";
break;
case eGameMapID::HowlingAbyss:
mapName = "Howling Abyss";
break;
case eGameMapID::TFT:
mapName = "Teamfight Tactics";
break;
default:
break;
}
Console::Add("Current map: %s", mapName);
# MissionMode
const char* Game::MissionMode()
Gets the mission mode of the current game.
const char* missionMode = Game::MissionMode();
Console::Add("Game mission mode: %s", missionMode);
# ModeName
const char* Game::ModeName()
Gets the name of the current game mode.
const char* modeName = Game::ModeName();
Console::Add("Game mode: %s", modeName);
# Ping
int Game::Ping()
Gets the current game network latency (in milliseconds).
int ping = Game::Ping();
Console::Add("Current network latency: %d ms", ping);
# Region
const char* Game::Region()
Gets the region of the current game server.
const char* region = Game::Region();
Console::Add("Game server region: %s", region);
# RoomName
const char* Game::RoomName()
Gets the name of the current game room.
const char* roomName = Game::RoomName();
Console::Add("Game room name: %s", roomName);
# Set_CursorPos
void Game::Set_CursorPos(Vector const& ScreenPos)
Sets the mouse cursor position on the screen.
Parameter Name | Parameter Type | Description |
---|---|---|
ScreenPos | Vector const& | Screen coordinate position |
// Move the mouse to the center of the screen
int width = Drawing::Width();
int height = Drawing::Height();
Vector screenCenter(width / 2.0f, height / 2.0f, 0);
Game::Set_CursorPos(screenCenter);
# Time
float Game::Time()
Gets the current game time (in seconds).
float gameTime = Game::Time();
Console::Add("Current game time: %.2f seconds", gameTime);
# ZoomHack
void Game::ZoomHack(float Height)
Sets the zoom height of the game camera.
Parameter Name | Parameter Type | Description |
---|---|---|
Height | float | Camera height |
// Increase camera height for a wider view
Game::ZoomHack(2000.0f);
# ZoomHeight
float Game::ZoomHeight()
Gets the current zoom height of the camera.
float height = Game::ZoomHeight();
Console::Add("Current camera height: %.1f", height);