示例#1
0
// Init initializes the width property with the provided element for animation.
func (h *Height) Init(elem govfx.Elemental) {
	h.elem = elem

	if h.Easer == nil {
		h.Easer = govfx.GetEasing(h.Easing)
	}

	if ws, _, ok := elem.ReadInt("width", ""); ok {
		h.current = float64(ws)
	}
}
示例#2
0
文件: colors.go 项目: influx6/govfx
// Init initializes the property for execution.
func (t *Color) Init(elem govfx.Elemental) {
	t.elem = elem

	rw, gw, bw, aw := govfx.ParseRGB(t.Color)
	t.color = ColorValue{red: rw, green: gw, blue: bw, alpah: aw}

	if color, _, ok := elem.Read("color", ""); ok {
		r, g, b, a := govfx.ParseRGB(color)
		t.color = ColorValue{red: r, green: g, blue: b, alpah: a}
	}
}
示例#3
0
// Init initializes the width property with the provided element for animation.
func (w *Width) Init(elem govfx.Elemental) {
	w.elem = elem

	if w.Easer == nil {
		w.Easer = govfx.GetEasing(w.Easing)
	}

	if ws, _, ok := elem.ReadInt("width", ""); ok {
		w.current = float64(ws)
	}
}