Premium Only Content

Rogue Engine - Component Basics - In Two Minutes
Components in Rogue Engine enable you to add code to objects in your scene.
The Rogue Engine framework is built on top of the Three.js library. Any object in a Rogue scene can have code attached to it to use the power of Three.js. These bits of code are called components.
Here is a very simple example of a Rogue Engine component.
You can use the default cube for this example.
First right click in the Assets panel and create a new component. Components can be javascript or typescript. We will use typescript. Give it a name and confirm.
That will create a blank component in the asset panel.
If you double click this icon it will open up in your default code editor. If you don't have one installed I would recommend downloading Visual Studio Code from Microsoft.
The blank component already has somethings set up. All components import the Rogue Engine
The component already has its class Export set up and three methods, awake, start and update. For this example we just need the update method.
We are going to rotate the cube in the scene so in the update method that runs each time the screen updates, we can write this.object3d.rotateY and then give it an angle.
This is fine but we don't know how fast the scene is updating so if we want to keep the rotation consistent whatever speed the scene is running, we can ask Rogue how long since the last update and use that value.
We get this delta value by reading RE.Runtime.deltaTime.
So that's our code - save it and go back to the Rogue Editor.
If we run our scene without the component attached to the cube, nothing happens. But if we add the component to the cube by dragging and dropping it and then run the scene, you will see that the cube rotates smoothly.
So that's how you add a basic component to an object in Rogue Engine.
-
Badlands Media
11 hours agoDEFCON ZERQ Ep. 010
151K34 -
9:46
Levi
1 day agoWhy XRP's Bull Run Will Be 10x Bigger Than The Last One - Raoul Pal
1421 -
20:13
Paul Barron Network
26 days agoXRP Vault Yields Coming in September!?🔥Flare CEO INTERVIEW
117 -
3:00:12
TimcastIRL
5 hours agoJimmy Kimmel Show IN CHAOS Before Return, Affiliates REFUSE, Staff Says THEYLL QUIT
345K95 -
2:49:26
Laura Loomer
6 hours agoEP145: Trump Makes BOMBSHELL Autism Announcement
40.2K18 -
SpartakusLIVE
7 hours agoEXPLOSIVE $400+ 2v2 Tuesday has viewers GLUED to the screen
54.4K1 -
3:19:06
GrimmHollywood
6 hours ago🔴LIVE • GRIMM'S TUESDAY FRIGHT NIGHT • STARRING GRIMM HOLLYWOOD • NO, I'M NOT HUMAN PART 1 •
34.5K2 -
1:21:01
Flyover Conservatives
13 hours agoAI Encouraged Suicide: The Global Experiment on Our Kids - Joe Allen | FOC Show
46.7K4 -
1:07:40
Glenn Greenwald
7 hours agoTucker Carlson on Charlie Kirk Assassination Fallout, Free Speech, Foreign Policy, and the Reaction to his Kirk Remarks | SYSTEM UPDATE #520
183K129 -
14:22
Robbi On The Record
2 days ago $2.23 earnedGen Z’s Narcissism Obsession: Why Everyone’s a “Psychologist”
45.3K14