Page 1 of 1

Ruby redraw?

Posted: Tue May 14, 2019 5:07 pm
by wlangfor@uoguelph.ca
Hi all, can someone tell me how to make Ruby Redraw?

The only method I have seen which counteracts fl studio glitching bg's and graphics is by using the bitmap animated frame method like with sliders.

That's possible too I guess. the BG could be made two frames and when editor is open it could automatically cycle simple. But I was wondering does someone know How to translate trigger events to a ruby redraw for the sake of experimentation?

Thanks alot,
Robert

Image

Re: Ruby redraw?

Posted: Sat May 18, 2019 12:13 pm
by trogluddite
There are two different ways that you could force a Ruby GUI redraw.

1) Add a trigger input to the Ruby primitive. In the 'event' method, test for the input ID of this input, and when it is triggered call the Ruby redraw method (the input value can be ignored for trigger inputs.) If no argument is given, the redraw method assumes that the GUI input will be the first one; if not, supply the method with a numeric index for the correct input; e.g. redraw(1).

2) Place a Redraw primitive in the RubyEdit prim's yellow GUI link and trigger it as you would normally - this will force an "implicit" redraw where the draw method gets called without going via the event method. In general, RubyEdits will implicitly be redrawn if they overlap some other component which gets redrawn (a Ruby background behind a primitive control, for example.)

To check whether redraws are happening as expected when I'm prototyping, I quite often use an instance variable counter that's incremented and sent to a dummy integer output within the 'draw' method - it can be surprising how often RubyEdit GUIs get redrawn without the Ruby code explicitly asking for it.

Re: Ruby redraw?

Posted: Mon May 20, 2019 3:23 pm
by wlangfor@uoguelph.ca
Thanks, printing the page as a pdf. I appreciate that Trogluddite :)