Jump to content

Mow can i make sliding text?


Recommended Posts

Posted

Use arc_ animation library or create your own animations with 'onClientRender' or 'getTickCount' events and position / alpha and other functions.

Guest Guest4401
Posted

The simplest way is to use math with onClientRender. I've done an example to show you how It can work. In this example, the text just moves from top left of your screen till 100 pixels and then stops.

local speed = 1 
local startAt = 0 
local stopAt = 100 
  
addEventHandler("onClientRender", getRootElement(), 
    function() 
        if startAt < stopAt then -- what you'd like to do till it reaches the point 
            dxDrawText("TEXT",0+startAt,0) 
            startAt = startAt + speed 
        else -- what you'd like to do after it reaces the point 
            dxDrawText("TEXT",stopAt, 0) 
        end 
    end 
) 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...