vortieveryday.blogg.se

Gideros documentation
Gideros documentation















Following this thread I managed to make them render in the background, however now all the GUIs elements get drawn behind the other elements. One problem that I’m currently facing is that (for what I understand) the GUIs are rendered in front of all the other elements. Gui.animate(root, gui.PROP_ROTATION, vmath.vector3(0, 0, 360), gui.EASING_LINEAR, 30, 0, nil, gui.PLAYBACK_LOOP_FORWARD) - start animation Gui.animate(root, gui.PROP_ROTATION, vmath.vector3(0, 0, -360), gui.EASING_LINEAR, 60, 0, nil, gui.PLAYBACK_LOOP_FORWARD) - start animation Gui.set_rotation(node, vmath.vector3(0, 0, i*2*rays_deg)) local function generate_rays(node_prot, n_rays, alpha) I’m currently trying solution and it seems to work pretty well, the rays can be generated dynamically. What approach would you choose to solve this “problem”? I’m still in the Gideros-way of thinking and I really want to open my mind the new possibilities Defold offers.

  • The rays color should be editable (easy? Rotate the hue of the sprites).
  • The rays rotation speed should be changed on the fly (easy, done with messages).
  • The number of rays should be decided when the object is initialized.
  • #Gideros documentation how to#

  • Use generated ray as I did in Gideros (couldn’t find a way to draw the shapes dynamically, the only solution I found is to message the renderer with draw_line but people said that it should be used for debugging only: How to draw rectangles, circles).
  • Use a pre-rendered image of one slice of the rays, use a factory to copy the sprite to multiple angles and then rotate all the sprites (kind of works, more efficient but the width of the rays can’t be changed without stretching the single ray).
  • gideros documentation

    (Works but it’s not memory efficient and the number of rays can’t be changed) Use a pre-rendered image of the rays and just rotate it in a script.In Defold I attempted the following “implementations” (from the “worst” to the ideally best): Local val2Y=self.radius*math.sin(current2Degrees) Local val2X=self.radius*s(current2Degrees) Local val1Y=self.radius*math.sin(current1Degrees) Local val1X=self.radius*s(current1Degrees) Local current2Degrees=math.rad((i+1)*greesPerRay/2) Local current1Degrees=math.rad(i*greesPerRay/2) Then a timer would take care of the rotation.

    gideros documentation

    The way I did in Gideros was to create a class GraphicRays and then generate N shapes with some simple math (not the most efficient nor best way, but it works nicely).

    gideros documentation

    Nothing fancy, just some shapes rotating clockwise and counterclockwise.















    Gideros documentation