{
class Example : NUIApplication
{
+ TextLabel _pointLabel;
+ Boolean _colorToggle;
+
public Example() : base()
{
}
Initialize();
}
+ private bool LabelTouched(object sender, View.TouchEventArgs e)
+ {
+ if (e.Touch.GetState(0) == PointStateType.Down)
+ {
+ Animation textColorAnimation = new Animation(1000);
+ if (_colorToggle)
+ {
+ textColorAnimation.AnimateTo(_pointLabel, "TextColorAnimatable", Color.Blue );
+ _colorToggle = false;
+ }
+ else
+ {
+ textColorAnimation.AnimateTo(_pointLabel, "TextColorAnimatable", Color.Green );
+ _colorToggle = true;
+ }
+ textColorAnimation.Play();
+ }
+ return true;
+ }
+
+
public void Initialize()
{
Window window = Window.Instance;
pixelLabel.BackgroundColor = Color.Magenta;
window.Add(pixelLabel);
- TextLabel pointLabel = new TextLabel("Test Point Size 32.0f");
- pointLabel.Position2D = new Position2D(10, 100);
- pointLabel.PointSize = 32.0f;
- pointLabel.BackgroundColor = Color.Red;
- window.Add(pointLabel);
+ _pointLabel = new TextLabel("Test Point Size 32.0f");
+ _pointLabel.Position2D = new Position2D(10, 100);
+ _pointLabel.PointSize = 32.0f;
+ _pointLabel.BackgroundColor = Color.Red;
+ _pointLabel.TextColorAnimatable = Color.Green; // Set initial text color using animatable property
+ _pointLabel.TouchEvent += LabelTouched;
+ _colorToggle = true;
+
+ window.Add(_pointLabel);
+
TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled.");
ellipsis.Size2D = new Size2D(100, 80);
example.Run(args);
}
}
-}
+}
\ No newline at end of file
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_TEXT_COLOR_get")]
public static extern int TextLabel_Property_TEXT_COLOR_get();
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_TEXT_COLOR_ANIMATABLE_get")]
+ public static extern int TextLabel_Property_TEXT_COLOR_ANIMATABLE_get();
+
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_SHADOW_OFFSET_get")]
public static extern int TextLabel_Property_SHADOW_OFFSET_get();
internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get();
internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
+ internal static readonly int TEXT_COLOR_ANIMATABLE = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_ANIMATABLE_get();
}
}
}
+ /// <summary>
+ /// TextColorAnimatable property.<br>
+ /// The color of the text that can be animatated.<br>
+ /// Animation framework can be used to change the color of the text when not using mark up.<br>
+ /// Not possible when text is auto scrolling. <br>
+ /// </summary>
+ public Color TextColorAnimatable
+ {
+ get
+ {
+ Color animatableColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
+ GetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE).Get(animatableColor);
+ return animatableColor;
+ }
+ set
+ {
+ SetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE, new Tizen.NUI.PropertyValue(value));
+ }
+ }
}
}