If you want blinking animation, you may do something like this:
local CUSTOM_EASING = vector {
0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1,
}
local WHITE = vmath.vector4(1, 1, 1, 1),
local TRANSPARENT_WHITE = vmath.vector4(1, 1, 1, 0)
...
self.caret = gui.get_node("...")
...
local function start_blinking()
gui.set_color(self.caret, WHITE)
gui.animate(self.caret, gui.PROP_COLOR, TRANSPARENT_WHITE, CUSTOM_EASING, 1, 0, nil, gui.PLAYBACK_LOOP_FORWARD)
end
local function stop_blinking()
gui.cancel_animation(self.caret, gui.PROP_COLOR)
gui.set_color(self.caret, TRANSPARENT_WHITE)
end