All Projects → utkuali → utk_render

utkuali / utk_render

Licence: GPL-3.0 license
Render game view to html canvas element

Programming Languages

javascript
184084 projects - #8 most used programming language
lua
6591 projects

Projects that are alternatives of or similar to utk render

FiveM-Paid-Anticheats
Fivem Anticheat's sources, cracks and other shit have fun with it. Remember API > ALL https://discord.gg/stz4nCkhZp
Stars: ✭ 35 (-12.5%)
Mutual labels:  fivem, fivem-script
menuv
FiveM menu library for creating menu's with NUI
Stars: ✭ 85 (+112.5%)
Mutual labels:  fivem, fivem-script
rprogress
Customisable radial progress bars for FiveM
Stars: ✭ 41 (+2.5%)
Mutual labels:  fivem, fivem-script
esx scoreboard
esx - scoreboard | A user friendly scoreboard for your server ;)
Stars: ✭ 28 (-30%)
Mutual labels:  fivem, fivem-script
esx repairkit
Simple repairkit script for FiveM ESX servers
Stars: ✭ 36 (-10%)
Mutual labels:  fivem, fivem-script
ZIRIXV2
Base vRPex para FiveM, desenvolvida pela equipe ZIRAFLIX, conjunto a alguns scripts da comunidade.
Stars: ✭ 22 (-45%)
Mutual labels:  fivem, fivem-script
Jeva
All scripts and code used through videos/tutorials on Jeva. Compiled by @ThatZiv
Stars: ✭ 156 (+290%)
Mutual labels:  fivem, fivem-script
Fivem
The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
Stars: ✭ 2,240 (+5500%)
Mutual labels:  fivem
fivem-vstancer
ikt's VStancer as resource for FiveM servers to synchronize the edited vehicles with all the players.
Stars: ✭ 37 (-7.5%)
Mutual labels:  fivem
FiveM-Civ-Car-Pack
A big library of civilian cars you can fork or download for your server
Stars: ✭ 92 (+130%)
Mutual labels:  fivem
CFX-BYPASS
Bypass it, you won't be Banned when playing cheats 2022
Stars: ✭ 18 (-55%)
Mutual labels:  fivem
NFive
NFive is a .NET plugin platform for FiveM
Stars: ✭ 53 (+32.5%)
Mutual labels:  fivem
fivem-react-boilerplate
FiveM + React 🐌
Stars: ✭ 21 (-47.5%)
Mutual labels:  fivem
MojiaGarages
🅿 Best advanced garages for QB-Core Framework 🚗
Stars: ✭ 16 (-60%)
Mutual labels:  fivem
hiype-cardelivery
FiveM car delivery resource for servers with QbCore Framework.
Stars: ✭ 40 (+0%)
Mutual labels:  fivem-script
altv-typescript
A Typescript Boilerplate for alt:V with simple setup and usage.
Stars: ✭ 32 (-20%)
Mutual labels:  fivem
interact-sound
A resource providing the ability to play sounds using the FiveM NUI environment.
Stars: ✭ 48 (+20%)
Mutual labels:  fivem
esx menu default
ESX Menu Style for FXSERVER gtaonline style
Stars: ✭ 30 (-25%)
Mutual labels:  fivem
fivem-ipl
The ultimate IPL loader for FiveM
Stars: ✭ 26 (-35%)
Mutual labels:  fivem
lgsl
LGSL v6.2.0 for PHP 5.4-8.2.0dev (Live Game Server List): online status for Discord, FiveM, Rust, CS, SA:MP, GMOD, Minecraft, Source Query, etc.
Stars: ✭ 101 (+152.5%)
Mutual labels:  fivem

FiveM Realtime GameView for HTML

Original script made by citizenfx

In-game streaming platform demonstration using utk_render

Installation

  • Put utk_render in your resource folder and start it like any other resource

  • script.js has a small config in it which you can define default upload url and field

Usage

  • in your html file put this code inside your body tag and make sure it's loaded before your scripts:
<script type="module" src="nui://utk_render/script.js"></script>

Handling Screenshot Uploads

To handle screenshot upload requests you can use this php code: https://github.com/melihozkara/fivem-php-img-uploader

Functions

Request Screenshot

Takes a screenshot and uploads it to the defined url

  • Async method:

    async function takeScreenshot() {
        let resp = await MainRender.requestScreenshot("www.exampleupload.com", "files[]");
        console.log("resp", resp);
    }
  • Normal method:

    MainRender.requestScreenshot("www.exampleupload.com", "files[]").then((resp) => {
        console.log("resp", resp);
    })

Render GameView to a canvas element

Can be used for a lot of stuff: video calls, video record, live stream ...

  • Start canvas render

    const canvas = document.getElementById("videocall-canvas");
    
    MainRender.renderToTarget(canvas);
  • Stop canvas render

    MainRender.stop();

Basic Example

  • html

    <body>
        <button id="start">Start Video Call</button>
        <button id="stop" disabled>Stop Video Call</button>
        <canvas id="videocall-canvas" style="display: none; position: absolute; width: 250px; height: 575px; right: 5px; bottom: 5px; border: solid 5px red;"></canvas>
    
        <script type="module" src="nui://utk_render/script.js"></script>
        <script src="index.js"></script>
    </body>
  • index.js

    const startButton = document.getElementById("start");
    const stopButton = document.getElementById("stop");
    const canvas = document.getElementById("videocall-canvas");
    
    startButton.addEventListener("click", () => {
        canvas.style.display = "block"
        MainRender.renderToTarget(canvas);
        stopButton.disabled = true;
        startButton.disabled = false;
    });
    
    stopButton.addEventListener("click", () => {
        MainRender.stop();
        stopButton.disabled = false;
        startButton.disabled = true;
    });

Important Note

Realtime render was made for my own phone therefore, render width and height ratio is fixed for 250px 575px which is 10 / 23 however, you can change this by some simple edits:

  • script.js line:37 and line:97

    // this width is 10 / 23 which is 250 to 575
    const width = Math.floor(window.innerHeight * 10 / 23);
    
    // 3rd parameter is left offset for the camera, setting it to 0 means most left side of the game, setting it to window.innerWidth / 2 means half of the game
    cameraRTT.setViewOffset(window.innerWidth, window.innerHeight, window.innerWidth / 3.5, 0, width, window.innerHeight);

To create a functional video call script, you need to look into WebRTC

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].