manups4e / ScaleformUI

ScaleformUI is a GTA menu styled API made with custom Scaleforms to be lighter, faster and visually better
Other
139 stars 49 forks source link

feat: add splash text #182

Closed Local9 closed 11 months ago

Local9 commented 11 months ago

Example;

local splashText = SplashTextInstance.New();
splashText:Load():next(function()
  splashText:SetLabel("Hello World!", 300.0, 255, 255, 255, 255, true);
end, function(err) print("Error: " .. err) end);

local count = 0;
local counter = 0;

CreateThread(function()
  while true do
    Wait(0);
    HideHudComponentThisFrame(14);
    SetScriptGfxDrawOrder(1);

    splashText:Draw();

    if count > 300 then
      splashText:SetLabel("Hello World! " .. tostring(counter), 300.0, 255, 255, 255, 255, true);
      splashText:TransitionIn(300);
      count = 0
      counter = counter + 1;
    end

    count = count + 1;

    if IsControlJustPressed(0, 38) then -- E
      splashText:TransitionIn();
    end

    if IsControlJustPressed(0, 23) then -- F
      splashText:TransitionOut(300);
    end
  end
end)

image