TheAweDam
(TheAweDam)
November 30, 2022, 11:30pm
1
Trying to make it so the message stays on screen longer after running Print.
Print<native><public>(Message:[]char, ?Duration:float = external {},
?Color:color = external {}):void
is the declaration of a string in verse. I have tried every possible way (tuples, manually entering parameters) to call this with all 3 parameters, but get an error every time.
Does anyone know how to properly call Print and how the parameter format needs to be?
Hey Adam! Just took some time to figure this out! I will definitely be switching to using Print() instead of Logger.Print()
Here’s the structure that you need, for both the duration & color!
There’s also a massive list of web colors within the Verse digest we can access just make sure to include the import path!
Print("ELIMS-TO-WIN: {EliminationsToWin}", ?Duration := 5.0, ?Color := color{R:=255.0,G:=0.0,B:=0.0})
# Module import path: /Verse.org/Colors/NamedColors
Print("ELIMS-TO-WIN: {EliminationsToWin}", ?Duration := 5.0, ?Color := CornFlowerBlue)
Just a screenshot of my Print() with the full red color.
3 Likes
TheAweDam
(TheAweDam)
December 1, 2022, 6:59pm
3
Thank you @spankysully1 , will test this out now and reply here with my results!
Note that the ?Color
syntax with the question mark denotes the parameter as optional. Means you can leave out ?Color
or ?Duration
you don’t need both.
3 Likes
TheAweDam
(TheAweDam)
December 1, 2022, 7:44pm
5
It worked! Does anyone know what to input for ?Duration to make it infinitely display on the screen?
So Print
is intended to be used for debugging, not for UI. So if you want to do UI work, you’ll need to start diving into VerseUI
.
I started with this:
Here is an example using text buttons, a stack box and a canvas. Note that there are a number of bugs in the current release so this will not work properly until the next public release.
using { /Verse.org/Simulation }
using { /EpicGames.com/Temporary/SpatialMath }
using { /EpicGames.com/Temporary/UI }
using { /Fortnite.com/Devices }
using { /Fortnite.com/UI }
hello_world_device := class(creative_device):
@editable
MyButton:button_device = button_device{}
var Canvas:?canvas = fal…
And you can see it used in my quick proof of concept for my last game jam using it here: Tactics Game Proof of Concepts | Talks and demos