![[Free][Utility] nbk_scaleform_draw2d | Draw Rect,Sprite,Text,Circle with scaleform main image](https://forum-cfx-re.akamaized.net/optimized/4X/3/1/b/31b403c07fb25be3825dae5acab5afb040613cac_2_690x161.png)
![[Free][Utility] nbk_scaleform_draw2d | Draw Rect,Sprite,Text,Circle with scaleform thumbnail 1](https://forum-cfx-re.akamaized.net/optimized/4X/3/1/b/31b403c07fb25be3825dae5acab5afb040613cac_2_690x161.png)
![[Free][Utility] nbk_scaleform_draw2d | Draw Rect,Sprite,Text,Circle with scaleform thumbnail 2](https://forum-cfx-re.akamaized.net/optimized/4X/c/b/e/cbe73afb0f93370d48e66a46ea11dfdd358bcecd_2_690x250.png)
![[Free][Utility] nbk_scaleform_draw2d | Draw Rect,Sprite,Text,Circle with scaleform thumbnail 3](https://img.youtube.com/vi/vobB8pdj3nk/0.jpg)
Price
UnknownA script by negbook
Price
UnknownWith this utility, You can draw everything just like before but without a loop thread.
Draw Texture without RequestStreamedTextureDict
Draw Scaleform Page without RequestScaleformMovie (just like the OL-WebBroswer)
A native drawing menu would be turn to 0.03~0.04ms from 0.15~0.17ms
It is free, if it help you a lot,You can buy some Coffee/Bread to me on the Tebex
Welcome to the nbk_scaleform_draw2d Wiki!
load(LoadResourceFile("nbk_scaleform_draw2d", 'import'))()
--automatic namespace
DrawRectS(x, y, width, height, r, g, b, a)
DrawCircleS(x, y, width, height, r, g, b, a)
DrawSpriteS(txDict, txName, x, y, w, h,heading, r, g, b, a)
DrawPageS(gfxFile, x, y, w, h,heading, r, g, b, a)
DrawTextS(strText, x, y, scale, r, g, b, a)
--custom namespace
DrawRectSF(NAME,x, y, width, height, r, g, b, a)
DrawCircleSF(NAME,x, y, width, height, r, g, b, a)
DrawSpriteSF(NAME,txDict, txName, x, y, w, h,heading, r, g, b, a)
DrawPageSF(NAME,gfxFile, x, y, w, h,heading, r, g, b, a)
DrawTextSF(NAME,strText, x, y, scale, r, g, b, a)
return handle -- All of them return a handle which can be used to remove or update textwrap something.
--Remove
DeleteRectSF(handle)
DeleteRectS(handle)
DeleteSpriteSF(handle)
DeleteSpriteS(handle)
DeletePageSF(handle)
DeletePageS(handle)
DeleteTextSF(handle)
DeleteTextS(handle)
TextDrawShow (handle)
TextDrawHide (handle)
TextDrawPosition (handle,x,y)
TextDrawSetPosition = TextDrawPosition
TextDrawString (handle, str)
TextDrawSetString = TextDrawString
TextDrawColor (handle, r, g, b, a)
TextDrawAlpha (handle, a)
TextDrawTextScale (handle, scale)
TextDrawTextSize = TextDrawTextScale
TextDrawFont(handle, fontstr) -- "$Font2", "$Font_cond" etc...
TextDrawBoxColour (handle, r, g, b, a)
TextDrawOutline (handle, isoutline)
TextDrawShadow (handle, r, g, b, a, blurX, blurY, strength)
TextDrawCenter (handle, iscenter)
TextDrawRight(handle, isright)
TextDrawWrap (handle, wrapL, wrapR)
TextDrawDestroy (handle)
TextDrawCreate = DrawTextS + TextDrawHide
--set colour if mouse hover the element
SetHoverColourBegin(r,g,b,a)
SetHoverColourEnd()
--set rainbow-color
SetAutoColourBegin(speed)
SetAutoColourEnd()
--set fade-in ready
SetFadeInBegin(fadegroup,inspeed, outspeed, isoutafterduration, outduration)
SetFadeInEnd()
--show the fade-in-ready group
SetFadeInShow(fadegroup)
SetFadeOut(fadegroup)
--automatic namespace with callback
DrawRectS(x, y, width, height, r, g, b, a, borderLength, br, bg, bb, ba, nobackground, cb)
DrawCircleS(x, y, width, height, r, g, b, a, cb)
DrawSpriteS(txDict, txName, x, y, w, h,heading, r, g, b, a, cb)
DrawPageS(gfxFile, x, y, w, h,heading, r, g, b, a, cb)
DrawTextS(strText, x, y, scale, r, g, b, a, cb)
--custom namespace with callback
DrawRectSF(NAME,x, y, width, height, r, g, b, a, cb)
DrawCircleSF(NAME,x, y, width, height, r, g, b, a, cb)
DrawSpriteSF(NAME,txDict, txName, x, y, w, h,heading, r, g, b, a, cb)
DrawPageSF(NAME,gfxFile, x, y, w, h,heading, r, g, b, a, cb)
DrawTextSF(NAME,strText, x, y, scale, r, g, b, a, cb)
--others
DrawCursorState("hand")
DrawCursorState("arrow")
DrawCursorState("text")
DrawCursorState("busy")
SetDebugMode(true) -- / false --drawing helper,I have no mention about this
DrawSelectionHook(true,cb) --Global Callback
DrawSelectionHook(true,function(info)
print(json.encode(info))
end)
-- put cb at the last params of elements
DrawTextSF("hello","hello",0.09,0.42000003679297,0.36500004290554,255,255,255,255,function(on)
on.click = function(selection)
print("wow this is hello click",selection)
DrawCursorState("busy")
end
on.hover = function(selection)
--print("wow this is hello hover",selection)
DrawCursorState("hand")
end
on.unhover = function(selection)
print("wow this is hello unhover",selection)
DrawCursorState("arrow")
end
end)
DrawTextS("~y~~h~he %NBK_CUSTOM1% %NBK_CUSTOM2% %NBK_CUSTOM3% ~n~ %FACE_TITLE% ~ws~ ~ws~ ~ws~",0.09,0.30000002339233,0.36500004290554)
Wait(5000)
AddTextEntry("NBK_CUSTOM2","HELLO2"..math.random(15,666))
Wait(5000)
AddTextEntry("FACE_TITLE","HELLO2"..math.random(15,666))
CreateThread(function()
while true do Wait(100)
AddTextEntry("NBK_CUSTOM1","HELLO"..math.random(0,150))
AddTextEntry("NBK_CUSTOM2","HELLO2"..math.random(15,666))
AddTextEntry("NBK_CUSTOM3","HELLO3"..math.random(32,1523))
end
end)
No approved reviews found for this script yet.