Snow plugin enable

  • I want to enable Snow plugin only after click of a button. I can make it initially to be invisible and after that to use

    Code
    switch(plugin[snow].visible)

    . But when I put enabled=false to the plugin it still loads and plays. And

    Code
    switch(plugin[snow].enable)

    doesn't work.

  • Hi bg360,

    I think you misunderstood the meaning of the enabled attribute:

    • visible
      true or false, default=true
    • enabled
      is plugin enabled to receive mouse events (true or false, default=true)
      NEW in Version 1.0.7:
      when false then mouse events are routed to underlying objects

    Enabled to receive mouse events... does not mean enabling the plugin himself...
    So, your first approach is the correct way to do:

    Code
    switch(plugin[snow].visible)

    SAlut.

  • Hi bg360,

    I think you misunderstood the meaning of the enabled attribute:

    Enabled to receive mouse events... does not mean enabling the plugin himself...
    So, your first approach is the correct way to do:

    Code
    switch(plugin[snow].visible)

    SAlut.

    Thanx Michel ! I didn't know that.

    Anyway, is there any way to switch the plugin (not only visibility), because it uses much CPU ? I want people to switch snowing only if they want. And I don't want the plugin to use their CPU if they don't want.

  • Hi,

    Anyway, is there any way to switch the plugin (not only visibility), because it uses much CPU ? I want people to switch snowing only if they want. And I don't want the plugin to use their CPU if they don't want.

    you could either remove the plugin by calling removeplugin(snow);
    or set the number of "flakes" to "0" and visible to "false", then almost no CPU will be used by the plugin,

    e.g.

    Code
    set(plugin[snow].flakes,0);
    set(plugin[snow].visible,false);

    best regards,
    Klaus

  • Thanx, Klaus!! It worx.
    Here is the code:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!