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.
-
DVR
iCkEdMeL
1 hour agoBOMBSHELL: Shooter’s Trans Partner Helped Take Him Down
9.75K8 -
1:42:45
The Big Migâ„¢
6 hours agoThe Islamic Invasion – The EU Has Fallen, A Warning For The USA |EP653
20.3K23 -
LIVE
Joker Effect
1 hour agoRUMBLE IN THE DEN 4 - Hungry fighters and NFL legend fight for respect
586 watching -
44:37
Rebel News
2 hours ago🔴 LIVE NOW: Massive ‘Unite the Kingdom’ Rally in London ft. Tommy Robinson | UKrebels.com
26.2K34 -
17:22
Professor Nez
2 hours ago💣BOMBSHELL: The Biden AutoPen Scandal JUST GOT REAL!
4.22K12 -
2:20:03
I_Came_With_Fire_Podcast
10 hours agoRevelations from the Ukrainian Front Lines
27.5K2 -
52:56
X22 Report
6 hours agoMr & Mrs X - Big Pharma Vaccine/Drug Agenda Is Being Exposed To The People - Ep 7
85.3K50 -
1:41:59
THE Bitcoin Podcast with Walker America
11 hours ago $17.40 earnedThe Assassination of Charlie Kirk | Walker America, American Hodl, Erik Cason, Guy Swann
69K34 -
21:33
marcushouse
6 hours ago $1.19 earnedSpaceX Just Revealed the Plan for Starship Flight 11! 🚀
29.5K9 -
35:03
Clownfish TV
9 hours ago'Live by the Sword, Die by the Sword.' | Clownfish TV
34.5K84