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.
-
LIVE
Nerdrotic
17 hours ago $4.59 earnedTemu WWIII Canceled Pride Month, but Not Ironheart - Nerdrotic Nooner 497
746 watching -
UPCOMING
Jeff Ahern
16 minutes agoMonday Madness with Jeff Ahern
-
LIVE
RalliedLIVE
1 hour ago $1.21 earnedSHOTTY BOYS WARZONE CHALLENGES
532 watching -
57:20
HotZone
6 hours ago $0.02 earnedWar Continues as Israel Strikes HARD in Lebanon and Iran
252 -
1:38:15
Russell Brand
2 hours agoGlastonbury Goes RADICAL - Police Probe 'Death to the IDF' Chant - SF605
168K15 -
1:32:42
Tucker Carlson
2 hours agoRFK Jr. Provides an Update on His Mission to End Skyrocketing Autism and Declassifying Kennedy Files
45.1K36 -
DVR
Sean Unpaved
2 hours agoCode, Kill, Cash & Trades: Beasley Bets & NFL Trades
14K1 -
1:06:29
MTNTOUGH Podcast w/ Dustin Diefenderfer
4 hours agoJeremy Noble: What Army Rangers Do Every Day to Build Unbreakable Mental Toughness | MTNPOD #122
4.96K -
LIVE
SternAmerican
1 day agoElection Integrity Call – Monday, June 30 at 2 PM EST | Hosted by Steve Stern & Raj Doraisamy
145 watching -
1:04:25
Timcast
3 hours agoDemocrat Zohran Mamdani Calls For TAXING WHITE PEOPLE, Media Says HES NOT Communist
207K70