# How to print text with duration and color?

**URL:** <https://forums.unrealengine.com/t/how-to-print-text-with-duration-and-color/1148664>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [April 29, 2023, 3:40pm UTC](https://forums.unrealengine.com/t/how-to-print-text-with-duration-and-color/1148664 "2023-04-29T15:40:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![R0ya1Eag1e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@R0ya1Eag1e](https://forums.unrealengine.com/u/R0ya1Eag1e)\
**Post date:** [April 29, 2023, 3:40pm UTC](https://forums.unrealengine.com/t/how-to-print-text-with-duration-and-color/1148664/1 "2023-04-29T15:40:15Z")

</div>

So, how to pass duration and color to Print function in Verse?

What i tried:

using { /Fortnite.com/Devices }  
using { /Verse.org/Simulation }  
using { /Verse.org/Colors }  
using { /Verse.org/Colors/NamedColors }

hello\_world\_device := class(creative\_device)  
{  
OnBegin():void=  
{  
MyColor := MakeColorFromSRGB(0.1, 0.2, 0.0)  
MyFloat := 31.0  
Print(“Text”, Duration := MyFloat, Color := MyColor)  
}  
}

Got this error: “This function parameter expects a value of type tuple([]char,?Duration:float = …,?Color:color = …), but this argument is an incompatible value of type tuple([]char,type{31.000000},color).(3509)”

Another attempts with no luck(paste only code in OnBegin function):  
1.  
MyColor := MakeColorFromSRGB(0.1, 0.2, 0.0)  
MyFloat := 31.0  
Print(“Text”, MyFloat, MyColor)  
2.  
Print(“Text”, 31.0, NamedColors.Blue)  
3.  
Print(“Text”, Duration:=31.0, Color:=MakeColorFromSRGB(0.1, 0.2, 0.0))  
4.  
MyText := “Text”  
MyFloat := 31.0  
MyColor := MakeColorFromSRGB(0.1, 0.2, 0.0)  
MyTuple := (MyText, MyFloat, MyColor)  
Print(MyTuple)  
5.  
MyText := “Text”  
MyFloat := 31.0  
MyColor := MakeColorFromSRGB(0.1, 0.2, 0.0)  
MyTuple := (MyText, Duration := MyFloat, Color := MyColor)  
Print(MyTuple)  
6.  
var MyText:[]char = “Text”  
var MyFloat:?float = false  
set MyFloat = option{31.0}  
var MyColor:?color = false  
set MyColor = option{MakeColorFromSRGB(0.1, 0.2, 0.0)}  
MyTuple := (MyText, Duration := MyFloat, Color := MyColor)  
Print(MyTuple)

---

<div class="post-metadata">

**Author:** ![HazeCoding](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hazecoding/32/691095_2.png) [@HazeCoding](https://forums.unrealengine.com/u/HazeCoding)\
**Post date:** [April 29, 2023, 5:13pm UTC](https://forums.unrealengine.com/t/how-to-print-text-with-duration-and-color/1148664/2 "2023-04-29T17:13:36Z")

</div>

Hey, you forgot to put a questionmark before the Print parameters, this should work:

```auto
 OnBegin<override>()<suspends>:void=
        MessageOne : []char = "text"
        ColorRed : color = color{R := 255.0, G := 0.0, B := 0.0}
        MyDuration : float = 3.5
        Print(MessageOne, ?Duration := MyDuration, ?Color := ColorRed)

```

---

<div class="post-metadata">

**Author:** ![gigikent7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gigikent7](https://forums.unrealengine.com/u/gigikent7)\
**Post date:** [June 12, 2024, 2:57pm UTC](https://forums.unrealengine.com/t/how-to-print-text-with-duration-and-color/1148664/3 "2024-06-12T14:57:53Z")

</div>

Thanks, Haze. This works. However, cannot stop noticing that this is a super convoluted way of getting a color. Should be a simple process. First, you need to declare that you’re going to use a colour (different “using” for Named and RGB ?!!!) and then the actual color variable declaration, where you need to input the RGB values separated by the color identifier and commas. Like wtf, as a new starter with Verse, I find it discouraging, honestly.  
Sorry for the rant, lol. Had to blow some steam. 😂
