Heptagono's Recent Forum Activity

  • Hi!

    I am trying to make this buttons change the values of some gobal variables.

    By now, all the buttons are the same object, and I'm calling each instance of them by looking at each's instance UID.

    So, the code looks like:

    <img src="https://www.dropbox.com/s/5rdxcz4u8ya7vkk/code.png" border="0">

    code

    And the project's layout is:

    <img src="https://www.dropbox.com/s/bxnukiv0kbabqba/layout.png" border="0">

    layout

    Unfortunately, the idea doesn't works and even clicking on the buttons and the variables don't change. Perhaps the code isn't correct.

    Here is the project file:

    test_instances.capx

    I presume that picking an instance n? is the same as select its UID.

    Any advice on why buttons don't change the variables as they're supposed to do?

  • Quote:

    -------------------------------------------

    If I recall correct, it is not enough to clamp them into the value range, they need to be integer values. Have you tried to set the (range corrected) values with

    "rgb("&int(red)& ... etc.?

    -------------------------------------------

    THAT WAS THE KEY!!!!!!

    GREAT!!! IT WORKS PERFECT.

    Thanks a lot, I was looking for a solution for this for weeks!

  • Hi!

    I've just tried this

    "red green and blue need to be integer values in the range [0, 255]. Setting green and blue to loopindex give them values above 255, which is invalid"

    changing the values of blue and green to make them remain between 0 and 255. But this still doesn't works and the result is a grey box.

    What else could be happening?

  • Hello,

    I'm involved in a project where the aim is to show a variable color pattern depending on a formula values. Although my efforts, I'm only obtaining a constant value of grey in the zone supposed to show a variable pattern from red to black. And I can't guess why.

    Here is the code:

    <img src="https://dl.dropboxusercontent.com/u/87172782/Patterns/crop.png" border="0">

    And the result:

    <img src="https://dl.dropboxusercontent.com/u/87172782/Patterns/Result.png" border="0">

    And, of course, the project:

    https://dl.dropboxusercontent.com/u/87172782/Patterns/Pattern.capx

    Anyone could give me a clue to find out why this is not being drawn as it's supposed to?

  • Hi mindfaQ,

    I've prepared this clear version of the test. Below the waves box you will see a black box, which is aimed to represent a pattern of vertical lines with different color values, from white to black, depending on the point of the wave represented alog the x axis: maximum point white, minimum point black.

    The x represents in the formula the whole lenght of the box, although I suspect it's aimed to be used only to show a point. If so, I fear all this effort could be in the wrong direction.

    By now, the version of the proyect is here:

    Test.capx

    What do you think?

  • Not sure what you mean with that. The code already does that, no? The slider is not a necessity.

    Ok, I've worked out a better explanation for this:

    Well, I mean that if we have two formulas to pick up the value of Amplitude and Period, let's say the ones I'm trying to implement:

    Amplitude: 4 * cos^2(Pi*X/Period)

    Period: Omega * Distance1 / 2 * Factor

    Omega and Factor are given by two sliders.

    They result in two real values, if they are introduced as variables in Draw Line:

    Having a sinus in the Y term, we can find ourselves with a wave that doesn't depicts the numbers from our mathematical formulae.

    That's the issue. I Hope this has been clearer. Tell me what do you think.

  • Here you have an example of System's Loop's misunderstoodment. It's probably the reason of seeing nothing shown at the screen:

    Code

    Project

    It's supposed to work because it's a loop and inside it there are some graphic instructions, isn't it?

  • mindfaQ, there is something that I want to ask you.

    Can I use an Amplitude and a Period value to draw a wave with the code you have showed me?

  • Wonderful solution!

    Now I can see that the appoach that I was using was not the best way to pick up a proper result. I'm goint to test It and tell you how it has been.

    Thanks and cheers!

  • Here you can find the project in it's last state:

    https://dl.dropboxusercontent.com/u/87172782/test.capx ]

    As you can see, the problem is that it seems no way to represent the changes in real time

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • wouldn't using the curve feature in the canvas plugin be easier?

    I have never used it before, I'll check it out

  • Y is a constant in the example.

    Oh, I'm going to change this inmediately

Heptagono's avatar

Heptagono

Member since 25 May, 2012

None one is following Heptagono yet!

Trophy Case

  • 12-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies