html5 float value issue

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I don't know if the HTML5 runtime can be modified so that it works exactly like the other runtimes in this case. In the other runtimes variables are typed (int or float), in HTML5 they have no type, this is a specificity of Javascript. The HTML5 runtime, to match the other runtimes, tries to detect if a variable is float or int. In your expression, the first part of the division is an integer (not sure why the distance expression returns an integer btw...), and has your variable as no decimals it thinks it's an integer so it does an integer division.

    The solution: multiply the first part of the epression by 1.0.

    Set X scale to ODistance( "obj1", X( "obj2" ), Y( "obj2" ) ) * 1.0 / varLineLength( "line" ) (Quality = 1)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!