Build ERROR by using label wrap width

Hunnenkoenig

  • Posts: 399
I try to set the label wrapper by using the width of a text using a font and I get this.
I think, that block doesn't work. I tried with floor of, and as number and everything else I could imagine.
It also happens if I just want to set it to screen width /2

Code: [Select]
jar:file:/Applications/Stencyl-full/sw.jar!/res/logview4j/images/info.gif false INFO 1413317927330038458 stencyl.sw.util.StreamGobbler (1 failure)
jar:file:/Applications/Stencyl-full/sw.jar!/res/logview4j/images/info.gif false INFO 1413317927330038457 stencyl.sw.util.StreamGobbler ExternalBuildToolExecution Build\ Haxe
jar:file:/Applications/Stencyl-full/sw.jar!/res/logview4j/images/info.gif false INFO 1413317927330038456 stencyl.sw.util.StreamGobbler The following build commands failed:
jar:file:/Applications/Stencyl-full/sw.jar!/res/logview4j/images/info.gif false INFO 1413317927329038455 stencyl.sw.util.StreamGobbler ** BUILD FAILED **
jar:file:/Applications/Stencyl-full/sw.jar!/res/logview4j/images/info.gif false INFO 1413317927204038454 stencyl.sw.util.StreamGobbler make: *** [build-haxe-armv7] Error 1
jar:file:/Applications/Stencyl-full/sw.jar!/res/logview4j/images/info.gif false INFO 1413317927204038453 stencyl.sw.util.StreamGobbler ../../../../Source/scripts/SceneEvents_2.hx:194: characters 68-78 : For function argument 'width'
jar:file:/Applications/Stencyl-full/sw.jar!/res/logview4j/images/info.gif false INFO 1413317927184038452 stencyl.sw.util.StreamGobbler ../../../../Source/scripts/SceneEvents_2.hx:194: characters 68-78 : Float should be Int

« Last Edit: October 14, 2014, 01:30:35 pm by Hunnenkoenig »

Justin

  • *
  • Posts: 4716
Which block specifically are you using?
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

Hunnenkoenig

  • Posts: 399
In the "Numbers & Text" - "Text" - "Get width for text using Font"

Justin

  • *
  • Posts: 4716
Sorry, I meant the block you're placing it into. The one that's expecting an int.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

Hunnenkoenig

  • Posts: 399
When Created a scene, and an IF is true I create a label and set the label's data for the last created actor. Font, text etc. I wanted to place the wrap there too.

Justin

  • *
  • Posts: 4716
Oh, you're using the labels extension. You can actually fix this one yourself then.

[stencyl workspace]/engine-extensions/label/blocks.xml
Line 25:
Code: [Select]
<block tag="label-wrap" spec="enable text-wrap for %0 using width: %1" code="Labels.enableTextWrap(~,~);" type="action" color="gray" returns="void">Change "Labels.enableTextWrap(~,~);" to "Labels.enableTextWrap(~,Std.int(~));"
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)


FortySe7en

  • Posts: 304
I always put 'as number' wrapper for anything I intend to put as label width, and that fixes it.

Hunnenkoenig

  • Posts: 399
Cool, thanks!
I will try it!

EDIT: It worked, but additionally I had to use "floor of"

« Last Edit: October 31, 2014, 05:36:18 pm by Hunnenkoenig »

FortySe7en

  • Posts: 304
oh yes, you need to round it to full numbers.
Perhaps you don't even need the 'as number' wrapper, as long as you round it.
Once you make a habbit of that, it's ok.