Author Topic: update artwork file_name (label)  (Read 2771 times)

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
update artwork file_name (label)
« on: December 07, 2016, 08:56:28 PM »
I swear you used to be able to update the type of artwork used for an artwork object by just setting file_name. Has this changed? I've tried numerous things including catching FromOldSelection transition and setting it there, but it just seems to look for a file instead of setting the dynamic artwork type.

Any ideas or am I crazy?

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: update artwork file_name (label)
« Reply #1 on: December 08, 2016, 07:14:43 PM »
So the answer is... use get_art in transition:

Code: [Select]
local snap = fe.add_artwork("snap", 50, 50, 320, 240)
local flyer = fe.add_artwork("snap", 300, 300, 320, 240)

fe.add_transition_callback(this, "on_transition")
function on_transition(ttype, var, ttime) {
    if ( ttype == Transition.StartLayout || ttype == Transition.FromOldSelection || ttype == Transition.ToNewList )
        flyer.file_name = fe.get_art("flyer", 0)
}
« Last Edit: December 08, 2016, 07:20:39 PM by liquid8d »