SetTextColor

(Difference between revisions)
Jump to: navigation, search
m
m
Line 3: Line 3:
 
Change the text color. Use a table with the color of the text with this format <code>{red, green, blue, alpha}</code>.
 
Change the text color. Use a table with the color of the text with this format <code>{red, green, blue, alpha}</code>.
  
'''Example 1: Change text color to red and semi-transparent.
+
'''Example 1:''' Change text color to red and semi-transparent.
  
 
     Text0 = getObject("Text0")
 
     Text0 = getObject("Text0")

Revision as of 18:09, 8 February 2014

setTextColor(object, color)

Change the text color. Use a table with the color of the text with this format {red, green, blue, alpha}.

Example 1: Change text color to red and semi-transparent.

   Text0 = getObject("Text0")
   function onSceneUpdate()
       if isKeyPressed("SPACE") then setTextColor(Text0, {1, 0, 0, 0.50}) end
   end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox