Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Applying transition to duotone filter
Started by alex_etc Oct 25 2016 01:42 PM

1 reply to this topic
transition filter effects
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

alex_etc

[GLOBAL: userInfoPane.html]
alex_etc
  • Observer

  • 7 posts
  • Corona SDK

Hello,

 

I've been trying to use the following:

 

    object.fill.effect = "filter.duotone"
    transition.to(object.fill.effect,
    {
      lightColor = { 0, 0, 0, 1 },
      darkColor = { 0.2, 0.2, 0.2, 1 },
      time = 200
    })
 
And i get the following error:
 

?:0: attempt to perform arithmetic on field '?' (a table value)
           stack traceback:
           ?: in function <?:504>
           ?: in function <?:169>

 
It also applies the filter though, but not with the parameters i set. It uses the default configuration of the filter. The one you get by not setting any optional parameters: darkColor, lightColor.
 
It does work properly when i directly assign the parameters:
 
object.fill.effect = "filter.duotone"

object.fill.effect.darkColor = { 0, 0, 0, 1 }
object.fill.effect.lightColor = { 0.2, 0.2, 0.2, 1 }
 
¿Am I not using the transition with the effect correctly? or ¿Is it "duotone" not compatible with transitions?
 


[TOPIC: post.html]
#2

alex_etc

[GLOBAL: userInfoPane.html]
alex_etc
  • Observer

  • 7 posts
  • Corona SDK

So I solved it myself.

 

    object.fill.effect = "filter.duotone"
    transition.to(object.fill.effect,
    {
      darkColor = 1,
      lightColor = 1,
      time = 200
    })
 
Thats how it works. Just treat the params as numbers.



[topic_controls]
[/topic_controls]



Also tagged with one or more of these keywords: transition, filter effects