Jump to content

Draw_Text: Error and Sound will not stop after lvl change or if disabled by button


Dan22
 Share

Recommended Posts

Hello, I am currently using the beta version of leadwerks and some errors have occured:

 

Draw_Text shows white blocks instead of the font:

 

42b2934ce66b8aeb7c86c5521fda9a85.png

 

As you can see on the top left they do not show. They use to work and now it no longer works even having not altering it in anyway.

 

Sound will not stop after lvl change,

 

even if the sound is not in the level once it has changed it still continues, I even tried using a button to stop it and it still doesn't stop.

 

Flowgraph trying to stop the sound:

 

c76467708d805398ded56eb3f1b760a4.png

 

 

Video:

 

 

After level change it still continues, even if I use a button as above.

 

If theres any person ways to fix these issues, please post below.

 

-Thanks

Link to comment
Share on other sites

I was using a draw_text script from downloads:

 

http://www.leadwerks.com/werkspace/files/file/464-draw-text/

 

Script:

 

Script.Text = "Enter Text Here"--String

Script.X = 0 --Int "X Position"

Script.Y = 0 --Int "Y Position"

Script.FontSize = 32 --Int "Font Size"

Script.Text_On = true --bool "Default On"

 

function Script:Start()

TextConfirm = self.Text_On

self.context = Context:GetCurrent()

self.window = self.context:GetWindow()

local font = Font:Load("Fonts/Coalition_v2..ttf",self.FontSize)

self.context:SetFont(font)

end

 

function Script:PostRender(context)

if (TextConfirm == true) then

self.context:SetColor(148,8,8)

self.context:DrawText(self.Text, self.X,self.Y)

self.context:SetBlendMode(Blend.Solid)

end

end

 

function Script:TextOn()--in

TextConfirm = true

end

function Script:TextOff()--in

 

TextConfirm = false

end

 

Also, it isn't because its a custom font, I used arial aswell and same results. I will see if thats the problem.

 

-Update: I changed it to alpha blend but still same problem.

Link to comment
Share on other sites

Something that is unclear to me in the flowgraph:

If you use the button, you both enable and disable the sound?

 

What you can do is adding an output to the load level script that disables your sound from playing. The output would be called before you actually load the level. It would look like this:

post-45-0-29719100-1398842624.jpg

Link to comment
Share on other sites

I Changed the function

 

function Script:Disable()--in

self.enabled=false

end

 

To,

 

function Script:Disable()--in

self.source:SetVolume(self.volume/999999999)

end

 

And this basicly stops the sound. Fixed now. However the guy who made the script should fix it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...