Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    centreShadowText: Draw centred text with a drop shadow

    Functions
    4
    4
    535
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dave
      Dave Fuze Team last edited by Dave

      centreShadowText() by @Dave
      Share Code: 5WG63MNDHQ

      //////////////////////////////////////////////////////////
      // centreShadowText() 
      // ----------------------------------------------
      // A function to draw text in the centre of the x-axis
      // at any y-axis position with an adjustable drop shadow
      //
      // ~Dave
      
      function centreShadowText( yPos, size, offset, textCol, shadowCol, text )
      	textSize( size )
      	float tw = textWidth( text )
      	float x = gwidth() / 2 - tw / 2
      	float y = yPos - size / 2
      	drawText( x - offset, y + offset, size, shadowCol, text )
      	drawText( x, y, size, textCol, text )
      return void
      
      
      // example usage
      centreShadowText( gheight()/2, 196, 5, white, grey, "Hello World" )
      update()
      sleep(3)
      
      
      1 Reply Last reply Reply Quote 4
      • vinicity
        vinicity F last edited by

        It says "Project not found" when trying to download this.

        1 Reply Last reply Reply Quote 1
        • Ben 2.0
          Ben 2.0 last edited by

          If you can't find the program this same function is used in 3d Crazy Shooter as well as some of the other demo programs. You might be able to find it there.

          E 1 Reply Last reply Reply Quote 1
          • E
            EvanTropFun @Ben 2.0 last edited by

            @Ben-2-0
            No, here too i seen't it

            1 Reply Last reply Reply Quote 0
            • First post
              Last post