UNPKG

rock-mod

Version:

Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.

50 lines (49 loc) 2.65 kB
import { Vector2D } from "../../../../shared/index"; export class RageGraphicsManager { drawText(text, position, options) { var _a, _b, _c, _d, _e; const arrayColor = (options === null || options === void 0 ? void 0 : options.color) ? [options.color.r, options.color.g, options.color.b, (_a = options.color.a) !== null && _a !== void 0 ? _a : 255] : [255, 255, 255, 255]; mp.game.graphics.drawText(text, [position.x, position.y], { font: (_b = options === null || options === void 0 ? void 0 : options.font) !== null && _b !== void 0 ? _b : 0, color: arrayColor, scale: (_c = options === null || options === void 0 ? void 0 : options.scale) !== null && _c !== void 0 ? _c : [0.3, 0.3], outline: (_d = options === null || options === void 0 ? void 0 : options.outline) !== null && _d !== void 0 ? _d : true, centre: (_e = options === null || options === void 0 ? void 0 : options.centre) !== null && _e !== void 0 ? _e : false, }); } world3dToScreen2d(position) { const { x, y, z } = position; const result = mp.game.graphics.world3dToScreen2d(new mp.Vector3(x, y, z)); if (!result) { return null; } return new Vector2D(result.x, result.y); } startScreenEffect(effectName, duration, looped) { mp.game.graphics.startScreenEffect(effectName, duration, looped); } stopScreenEffect(effectName) { mp.game.graphics.stopScreenEffect(effectName); } setPtfxAssetNextCall(assetName) { mp.game.graphics.setPtfxAssetNextCall(assetName); } startParticleFxNonLoopedAtCoord(options) { return Boolean(mp.game.graphics.startParticleFxNonLoopedAtCoord(options.effectName, options.position.x, options.position.y, options.position.z, options.rotation.x, options.rotation.y, options.rotation.z, options.scale, options.xAxis, options.yAxis, options.zAxis)); } startParticleFxLoopedAtCoord(options) { return mp.game.graphics.startParticleFxLoopedAtCoord(options.effectName, options.position.x, options.position.y, options.position.z, options.rotation.x, options.rotation.y, options.rotation.z, options.scale, options.xAxis, options.yAxis, options.zAxis, options.p11); } stopParticleFxLooped(handle, p1) { mp.game.graphics.stopParticleFxLooped(handle, p1); } getSafeZoneSize() { return mp.game.graphics.getSafeZoneSize(); } getActiveScreenResolution() { const result = mp.game.graphics.getActiveScreenResolution(); return new Vector2D(result.x, result.y); } }