Effects for Images on mobile? [SOLVED]

megagewinnspiel

  • Posts: 396
Hey guys,

I just wanted to ask if those blocks will ever or even better in the near future be available to use on mobile devices?


« Last Edit: September 01, 2015, 06:26:40 am by megagewinnspiel »

yoplalala

  • *
  • Posts: 1632
In script.hx  it's written
//TODO: Reuse Actor's setFilter if possible.

so maybe they have a plan for it but don't know how to do it.
At least they a plan to do it :)

megagewinnspiel

  • Posts: 396
Good to know :)
Do you know any method of working around that?
I am planning on creating a shadow for an actor but this oddly does not work:

The Image Instance is black as long as the actor is black but as soon as I remove the effect, the image looses its effect aswell...

Eriko

  • Posts: 162
Did you try to apply the effect to "shadow"?

megagewinnspiel

  • Posts: 396
This wouldn't work on mobile devices since (look at the first post) those blocks only work on flash.

yoplalala

  • *
  • Posts: 1632
Hum, I've tried to do some highlight of my actor with the image api but I was cinfrinted to the same problem , so I can't give you any tip :(

yoplalala

  • *
  • Posts: 1632
OKay I think I have something.
Add a custom import event,
put inside it
Code: [Select]
import nme.geom.ColorTransform;
Then  inside the normal code, but a block code
Code: [Select]
var ct_temp:ColorTransform;
ct_temp = new ColorTransform();
ct_temp.color = _Color; /// Color is the attribute of colour black for you, you have to create it
_image.colorTransform(_image.rect, ct_temp);  // _image is the image of the Shadow ( not the image instance , the image)

letmethink

  • *
  • Posts: 2545
I think this should work:

Code: [Select]
var ct_temp:openfl.geom.ColorTransform;
ct_temp = new openfl.geom.ColorTransform();
ct_temp.color = _Color; /// Color is the attribute of colour black for you, you have to create it
_image.colorTransform(_image.rect, ct_temp);  // _image is the image of the Shadow ( not the image instance , the image)
~Letmethink

megagewinnspiel

  • Posts: 396
Alright thanks @yoplalala @letmethink

This costum behaviour works perfect to quickly change the color of an image:

Code: [Select]
var ct_temp:openfl.geom.ColorTransform;
ct_temp = new openfl.geom.ColorTransform();
ct_temp.color = __Color;
__Image.colorTransform(__Image.rect, ct_temp);
return __Image;

« Last Edit: September 01, 2015, 05:22:53 am by megagewinnspiel »