Cosmos: How To Add Text in Cosmos GUI????

Created on 12 Oct 2020  路  11Comments  路  Source: CosmosOS/Cosmos

How to add Text in Cosmos GUI???

I'm Using Userkit...

Thanks!

Most helpful comment

You edit them to fit your namespace then its just a matter of calling the Function like this

FontDrawer.WriteText("Hello World", 100, 100, Color.White)
for example

All 11 comments

@KM198912 But How to use theese files???

You edit them to fit your namespace then its just a matter of calling the Function like this

FontDrawer.WriteText("Hello World", 100, 100, Color.White)
for example

Is there a way to make the text "auto-updatable"? Like I want a string that shows the X and Y coordinates of the Mouse, but the string gets weird. Isn't there a way to do that?

it worked for me when i had it running in the Run method using a seperate while loop

bool isRunning = true;
while(isRunning)
{
FontDrawer.WriteText("Mouse X: " + Sys.MouseManager.X  + " Mouse Y: " + Sys.MouseManager.Y,100,100,Color.White);
}

But for the string updating it adds another string on top of the original one so it makes it weird, is there any way to make it updating like so?

To keep the strings from drawing over each other, you have to clear the current string before drawing the next one. To clear the string, I draw a filled rectangle the same color as the screen background over the text.

To keep the strings from drawing over each other, you have to clear the current string before drawing the next one. To clear the string, I draw a filled rectangle the same color as the screen background over the text.

You could also redraw the same string in the same color as the background

Thanks @KM198912! I'll try!! 馃榾

I Tried it It's Not Working :(((

I Tried it It's Not Working :(((

show me your code and i will see whats wrong

Was this page helpful?
0 / 5 - 0 ratings

Related issues

365Tito picture 365Tito  路  10Comments

jpmac26 picture jpmac26  路  8Comments

manamster picture manamster  路  4Comments

365Tito picture 365Tito  路  11Comments

fanoI picture fanoI  路  8Comments