R0J0hound's Forum Posts

  • You can think of vertices as just points. Most 3d modeling programs use that term.

    Anyways UVs are just texture coordinants. Much like XY give a location on the layout, UV gives a location on a texture. UVs go from 0 to 1. Say this square is an image, the following shows the UV of each corner.

    (0,0)
    +----+ (1,0)
    |....|
    |....|
    +----+ (1,1)
    (1,0)

    Since UVs are in the range 0 to 1 this is called normalized coordinates. It's useful as opposed to pixel coordinates because it works for any image size. If you want to use pixel coordinates you can convert it to uvs with (x/imageWidth, y/imageHeight).

  • Hi,

    Making the distortions better is out of the scope of this plugin. Mayne it's solvable via a shader or utilizing perspective correct texturing. Both would require a fair amount of shenanigans to be able to do that within C2's renderer. One half solution is to subdivide into smaller quads, and perhaps changing how the quad is made out of triangles could give some improvements. The latter could be done by rotating the order of the vertices as needed. Could be something to experiment with.

    As is the distortion works well with scaling, sheering, or rotating. Perspective isn't possible with affine transformations without hacking the renderer to be 3d or some special case shader.

    For your second question you can do that with uvs. Just set the xy and uv of all four vertices and use the "draw quad with uv" action.

    dropbox.com/s/ganjw6d7v7i43ab/paster_Tomycase.capx

  • Apparently that execCommand function is deprecated in browsers now, and the following is the new way. The docs indicate it won’t work in a webworker and needs the website to be https.

    Execute js "navigator.clipboard.writeText('"&Textbox.text&"')"

  • This is the latest version of using distort mesh to make a sprite into a cube and rotating it by x,y and/or z. The angle, angular speed, and size of each cube can be set with variables.

    construct.net/en/forum/construct-3/your-construct-creations-9/example-mesh-distort-sphere-161470

  • joelmayer

    Updated it again to fix that error when loading into c3. Also I found the set color effect works different in c3 so I fixed that as well so it will work correct if run from c3 or c2.

  • They aren’t available. You can see the runtime portions of them with the browser console when previewing, but the edittime part is obfuscated with the rest of the editor.

  • Updated again:

    * fixed the coloring issue.

    * let you use "white" or "black" as a color in addition to "r,g,b".

    * added an option to change the background to be darker when using lighter colors.

    * now generates the "spacing data json" that C3 uses. So in c3 no events are needed to setup the spacing. joelmayer

    * some general event cleanups.

  • Here’s one example of a way to do it. It’s a bit old so it should be possible to do it in a cleaner way now.

    construct.net/en/forum/construct-3/your-construct-creations-9/example-mesh-distort-sphere-161470

    The gist is you make the meshes by bending distort meshes around. Worst case you use a sprite per face. So you’d have a list of vertex positions that you’d rotate by multiplying by a 3x3 rotation matrix or something like that.

    Other more recent examples of distort mesh 3D. But they are focusing on some other aspects.

    construct.net/en/forum/construct-3/your-construct-creations-9/3d-raycasting-obj-loader-test-167475

    construct.net/en/forum/construct-3/how-do-i-8/create-3d-dice-rotation-167723

  • totoe

    Unfortunately in the browser you can only check if a font is installed. You can’t get a list of all the installed fonts.

    Most online editors just have a list of fonts that they check to see are installed. Perhaps I could do something like that at some point.

  • joelmayer

    I need to look around at the asjson format at bit more. It’s no problem generating it, but I don’t need all the data such as position and size.

    Currently you still need to fiddle with the grid sizes and offsets so that all the characters fit in their own boxes. A future idea would be to automatically find those values for a best fit and smaller overall image size. A side effect is it would allow larger textures too without as many workarounds as I have now.

  • ashconstruct

    Download again. It now lets you change color.

    tarek2

    I added an option to remove the aliasing with an effect. Beyond that I’ll have to go beyond construct to have more rendering options. The text object will look blurry if you change the construct project setting from high quality to low quality. So I think construct renders text at a higher res and scales down.

  • Updated.

    * aliasing with threshold.

    * offset x and y instead of using the same value.

    * color

    * gui cleanup

    * gridlines to see if the characters fit in the bounds.

    * fix so characters are less likely to be clipped.

    * fix some math errors.

    Known bugs:

    FIXED: * color with threshold seems to be broken.

    * If the image size is bigger than 1024x512 things will break.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is a tool to help generate a Spritefont from any font:

    dropbox.com/s/zh299ngxv6lbfwq/spritefont_gen.capx

    Here is an example of using the generated spritefont:

    You setup the spritefont with the generated image, set the character width/height to the same as what you used in the tool, and finally use one event to set the individual character widths from the tool. Or in C3 you just set the spacing data.

    C2 example:

    dropbox.com/s/3iw0zrr0xh8skdi/spritefont_test.capx

    C3 examples:

    dropbox.com/s/3iw0zrr0xh8skdi/spritefont_test.capx

    dropbox.com/s/6xlkjo1blewshff/spritefont_test_arial.c3p

    known bugs:

    * You need to make sure all the letters fit onscreen or it will break.

    -cheers

  • That’s got me a few times. With array: for each x it doesn’t set loopindex, you have to use array.curX

  • You just have to use two numbers to represent a vector. And do math per component.

    So instead of something like c=a+b you’d do:

    cx=ax+bx

    cy=ay+cy

    And instead of normalize(a) it would be:

    mag=sqrt(ax*ax+ay*ay)

    ax = ax/mag

    ay = ay/mag

    And stuff like that. So you may need more variables to to temporarily store the steps of the calculations.