This repository was archived by the owner on Feb 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Ruby
Max Narvaez edited this page Jan 18, 2020
·
4 revisions
An AnimationSender is constructed with two arguments:
-
host: The IP address of the server (as a string) -
port: The port that the client should connect to (as an integer)
sender = AnimationSender.new("10.0.0.254", 5);An AnimationSender is started by calling the start() method on the instance.
sender.startTo stop the AnimationSender, call its end() method.
sender.endAn animation can be sent to the server by creating an AnimationData instance, then calling sendAnimation with the instance as the argument.
cc = ColorContainer.new
cc.add_color 0xFF
cc.add_color 0xFF00
data = AnimationData.new
data.add_color cc
sender.send_animation dataThe Ruby library uses the following values for animation, continuous and direction:
-
animation:Animation::COLOR,Animation::ALTERNATE,Animation::RIPPLE, etc. -
continuous:nil,true,false -
direction:Direction::FORWARD,Direction::BACKWARD
Currently the Ruby library only supports sending data.