playMaker

Author Topic: Gradient like Colors of Tiles[SOLVED]  (Read 1731 times)

rizwanash

  • Junior Playmaker
  • **
  • Posts: 61
Gradient like Colors of Tiles[SOLVED]
« on: June 27, 2019, 07:16:00 AM »
Hey guys,

I have a Tiles Setup like Stack game and i would like to create a color effect like it.
How to create a Color palette like Stack Game in Playmaker. There is a Video on YouTube, He is doing that via this line of code.


Here is the Video:

Thank you in advance.
« Last Edit: July 05, 2019, 09:57:54 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Gradient like Colors of Tiles
« Reply #1 on: June 27, 2019, 12:32:57 PM »
Hi.
I made action to set the hsv which stands for hue, saturation, Brightness (Volume)
also you can set the alpha if needed.

In the hue you can adjust the color.

You can get that value by doing :

Level Divide by 100 (float divide or float operator)
the use 'Float Modulo' (Ecosystem)

in Dividend you place the result from above and Diviser should be 1

Then use that result in hue.

« Last Edit: June 27, 2019, 12:34:35 PM by djaydino »

rizwanash

  • Junior Playmaker
  • **
  • Posts: 61
Re: Gradient like Colors of Tiles
« Reply #2 on: June 27, 2019, 02:28:47 PM »
Hey,

Thank you so much for your time, Can i get a little more detail on it, I am new here. How can i adjust the color? Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Gradient like Colors of Tiles
« Reply #3 on: June 28, 2019, 06:56:58 AM »
Hi.

You can set the color by using 'Material Set Color'


So first do the actions i mentioned on my earlier post, then you can set that color to the material

rizwanash

  • Junior Playmaker
  • **
  • Posts: 61
Re: Gradient like Colors of Tiles
« Reply #4 on: June 28, 2019, 07:39:28 AM »
I have tiles in every level, they are different in numbers, so if i count tiles, it shows in debug how many tiles are in levels but i only get 0 for dividing by 100. I am using Float operator and i am converting Global Int of TilesCount. am i missing some steps here ? Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Gradient like Colors of Tiles
« Reply #5 on: June 29, 2019, 12:49:07 PM »
Hi.
Can you show your fsm, states, actions so i can see what the issue is.

Can you try the action 'Convert Int To Float' action instead of converting directly in the action (to see if you have the same result).

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Gradient like Colors of Tiles
« Reply #6 on: July 04, 2019, 03:38:45 AM »
Hi,

 You should cut down the problem in smaller chunck and put it back up when you have each part working on its own.

Make a system can return a color within a defined range, let's say the range is 0 to 10, and a hsv color between say 40 and 80 in Hue ( using HSV actions on the ecosystem is key here, you got that right?)

this means that you need to remap a value ranging from 0 to 10 to a value ranging from ( using the custom action floatremap on the ecosystem)

so 0 ->40 and 10 -> 80

Now, as you change the value ranging from 0 to 10, you should have your hue moving from 40 to 80, and thus you get a color associated with that 0-10 range.

That would be your first step. Once you have that working, you can then use that logic within your game, and you will likely adjust the ranges, but that's already tweaking.

Let me know how you progress on this.

 Bye,

 Jean

rizwanash

  • Junior Playmaker
  • **
  • Posts: 61
Re: Gradient like Colors of Tiles
« Reply #7 on: July 05, 2019, 03:56:19 AM »
Hi Jean, I used a C# Script with a custom shader for that, also djaydino helped with custom actions.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Gradient like Colors of Tiles
« Reply #8 on: July 05, 2019, 04:09:07 AM »
Hi,

 ok, Cool!

 Bye,

 Jean

rizwanash

  • Junior Playmaker
  • **
  • Posts: 61
Re: Gradient like Colors of Tiles
« Reply #9 on: July 05, 2019, 05:37:15 AM »
Mark this as Solved too.