<Compile Include="examples\user-alphafunction.cs" />\r
<Compile Include="examples\view-navi-property.cs" />\r
<Compile Include="examples\visual-animation-test.cs" />\r
+ <Compile Include="examples\visual-view-test2.cs" />\r
<Compile Include="examples\visual-view-test.cs" />\r
<Compile Include="examples\visuals-using-custom-view\ContactData.cs" />\r
<Compile Include="examples\visuals-using-custom-view\ContactView.cs" />\r
//new VisaulAnimationExample.Example().Run(args);
//new VisualViewTest.Example().Run(args); //o
//new RelativeVectorTest.Example().Run(args);
+ //new VisualViewTest2.VisualSample().Run(args);
}
}
}
//////////////////////////////////////////////////////////////////////
// Create a conttent view
_contentView = new VisualView();
- _contentView.WidthResizePolicy = ResizePolicyType.Fixed;
- _contentView.HeightResizePolicy = ResizePolicyType.Fixed;
- _contentView.Size2D = new Size2D(250, 250);
+ _contentView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent;
+ _contentView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
+ //_contentView.Size2D = new Size2D(250, 250);
_contentView.BackgroundImage = _resPath + "/images/background-blocks.jpg";
ImageVisual _icon = new ImageVisual();
_icon.PositionPolicy = new Vector2(1, 1);
_icon.Origin = Visual.AlignType.TopBegin;
_icon.AnchorPoint = Visual.AlignType.TopBegin;
+ _icon.MixColor = new Color(0, 1, 0, 0.5f);
+ _icon.Opacity = 0.5f;
_contentView.AddVisual("icon_visual1", _icon);
contentLayout.AddChild(_contentView, new TableView.CellPosition(0, 0));
contentLayout.AddChild(_shadowButton, new TableView.CellPosition(0, 1));
//////////////////////////////////////////////////////////////////////
+ // make NPatch visual test
+ NPatchVisual npatch1 = new NPatchVisual();
+ npatch1.URL = _resPath + "/images/gallery-2.jpg";
+ npatch1.Size = new Size2D(400, 400);
+ npatch1.SizePolicy = new Vector2(1, 1);
+ npatch1.Position = new Position2D(400, 0);
+ npatch1.PositionPolicy = new Vector2(1, 1);
+ npatch1.Origin = Visual.AlignType.TopBegin;
+ npatch1.AnchorPoint = Visual.AlignType.TopBegin;
+ npatch1.Border = new Rectangle(100, 100, 100, 100);
+ npatch1.DepthIndex = 2;
+ npatch1.MixColor = new Color(1, 0, 0, 1);
+ npatch1.Opacity = 0.5f;
+ _contentView.AddVisual("npatchImageVisual1", npatch1);
+
+
+ //////////////////////////////////////////////////////////////////////
// make SVG visual test
VisualView VisualView1 = new VisualView();
VisualView1.WidthResizePolicy = ResizePolicyType.FillToParent;
--- /dev/null
+using System;
+using Tizen.NUI;
+
+namespace VisualViewTest2
+{
+ public class VisualSample : NUIApplication
+ {
+ const int num = 2;
+ VisualView[] view;
+
+ TextLabel guide;
+ ImageVisual imageMap;
+ ImageVisual imageMap2;
+
+ ImageVisual highlightImageMap;
+ ImageVisual dimImageMap;
+
+ TextVisual textMap1;
+ TextVisual textMap2;
+
+ int imgIndex;
+
+ readonly string resourcePath = "/home/owner/apps_rw/NUISamples.TizenTV/res/images/";
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+
+ view = new VisualView[2];
+
+ for (int i = 0; i < num; i++)
+ {
+ view[i] = new VisualView();
+ view[i].Size = new Size(600, 600, 0);
+ view[i].BackgroundColor = Color.Blue;
+ view[i].Position = new Position(400 + i * 800, 600, 0);
+ view[i].Focusable = true;
+ view[i].Name = "MyView" + i;
+ Stage.Instance.GetDefaultLayer().Add(view[i]);
+ view[i].FocusGained += VisualSample_FocusGained;
+ view[i].FocusLost += VisualSample_FocusLost;
+ view[i].KeyEvent += VisualSample_KeyEvent;
+ }
+
+ view[0].RightFocusableView = view[1];
+ view[1].LeftFocusableView = view[0];
+
+ imageMap = new ImageVisual();
+ imageMap.URL = resourcePath + "gallery-" + imgIndex++ + ".jpg";
+ imageMap.AnchorPoint = Visual.AlignType.TopBegin;
+ imageMap.Origin = Visual.AlignType.TopBegin;
+ imageMap.Position = new Vector2(0, 0);
+ imageMap.PositionPolicy = new Vector2(1, 1);
+ imageMap.Size = new Vector2(500, 500);
+ imageMap.SizePolicy = new Vector2(1, 1);
+ imageMap.DepthIndex = 0;
+ view[0].AddVisual("bgVisual", imageMap);
+
+
+ highlightImageMap = new ImageVisual();
+ highlightImageMap.URL = resourcePath + "star-highlight.png";
+ highlightImageMap.AnchorPoint = Visual.AlignType.TopBegin;
+ highlightImageMap.Origin = Visual.AlignType.TopBegin;
+ highlightImageMap.Size = new Vector2(40, 40);
+ highlightImageMap.SizePolicy = new Vector2(1, 1);
+ highlightImageMap.Position = new Vector2(10, 10);
+ highlightImageMap.PositionPolicy = new Vector2(1, 1);
+ highlightImageMap.DepthIndex = 1;
+ view[0].AddVisual("iconVisual", highlightImageMap);
+
+
+ textMap1 = new TextVisual();
+ textMap1.Text = "Hello";
+ textMap1.AnchorPoint = Visual.AlignType.TopBegin;
+ textMap1.Origin = Visual.AlignType.TopBegin;
+ textMap1.PointSize = 20;
+ textMap1.Position = new Vector2(60, 210);
+ textMap1.PositionPolicy = new Vector2(1, 1);
+ textMap1.Size = new Vector2(600, 200);
+ textMap1.SizePolicy = new Vector2(1, 1);
+ textMap1.TextColor = Color.Red;
+ textMap1.DepthIndex = 5;
+ view[0].AddVisual("textVisual", textMap1);
+
+
+
+ imageMap2 = new ImageVisual();
+ imageMap2.URL = resourcePath + "gallery-" + imgIndex + ".jpg";
+ imageMap2.AnchorPoint = Visual.AlignType.TopBegin;
+ imageMap2.Origin = Visual.AlignType.TopBegin;
+ imageMap2.Position = new Vector2(0, 0);
+ imageMap2.PositionPolicy = new Vector2(1, 1);
+ imageMap2.Size = new Vector2(500, 500);
+ imageMap2.SizePolicy = new Vector2(1, 1);
+ imageMap2.DepthIndex = 0;
+ view[1].AddVisual("bgVisual", imageMap2);
+
+ dimImageMap = new ImageVisual();
+ dimImageMap.URL = resourcePath + "star-dim.png";
+ dimImageMap.Size = new Vector2(40, 40);
+ dimImageMap.SizePolicy = new Vector2(1, 1);
+ dimImageMap.AnchorPoint = Visual.AlignType.TopBegin;
+ dimImageMap.Origin = Visual.AlignType.TopBegin;
+ dimImageMap.Position = new Vector2(10, 10);
+ dimImageMap.PositionPolicy = new Vector2(1, 1);
+ dimImageMap.DepthIndex = 1;
+ view[1].AddVisual("iconVisual", dimImageMap);
+
+ textMap2 = new TextVisual();
+ textMap2.Text = "I'm";
+ textMap2.PointSize = 20;
+ textMap2.AnchorPoint = Visual.AlignType.TopBegin;
+ textMap2.Origin = Visual.AlignType.TopBegin;
+ textMap2.Position = new Vector2(60, 210);
+ textMap2.PositionPolicy = new Vector2(1, 1);
+ textMap2.Size = new Vector2(600, 200);
+ textMap2.SizePolicy = new Vector2(1, 1);
+ textMap2.TextColor = Color.Black;
+ textMap2.DepthIndex = 5;
+ view[1].AddVisual("textVisual", textMap2);
+
+
+ guide = new TextLabel();
+ guide.AnchorPoint = AnchorPoint.TopLeft;
+ guide.Size2D = new Size2D(800, 200);
+ guide.Padding = new Vector4(50, 50, 50, 50);
+ guide.MultiLine = true;
+ guide.BackgroundColor = Color.Magenta;
+ guide.PointSize = 10;
+ guide.TextColor = Color.Black;
+ guide.Text = "Left/Right - Move focus\n" +
+ "Up/Down - Change Text\n" +
+ "Enter - Change BG image\n";
+ Stage.Instance.GetDefaultLayer().Add(guide);
+
+ Stage.Instance.Key += Instance_Key;
+ FocusManager.Instance.SetCurrentFocusView(view[0]);
+ Stage.Instance.Touch += Instance_Touch;
+ }
+
+
+ private void Instance_Touch(object sender, Stage.TouchEventArgs e)
+ {
+ FocusManager.Instance.SetCurrentFocusView(view[0]);
+ }
+
+ private bool VisualSample_KeyEvent(object source, View.KeyEventArgs e)
+ {
+ Tizen.Log.Debug("NUI", "View_KeyEvent" + e.Key.State.ToString() + ", Pressed-" + e.Key.KeyPressedName);
+
+ if (e.Key.State == Key.StateType.Down)
+ {
+ if (source.Equals(view[0]))
+ {
+ if (e.Key.KeyPressedName == "Up")
+ {
+ textMap1.PointSize = 14;
+ textMap1.TextColor = Color.Red;
+ textMap1.Text = "Hello NY!";
+ }
+ else if (e.Key.KeyPressedName == "Down")
+ {
+ textMap1.PointSize = 17;
+ textMap1.TextColor = Color.Blue;
+ textMap1.Text = "Goodbye NY.";
+ }
+ else if (e.Key.KeyPressedName == "Return")
+ {
+ imgIndex = (imgIndex + 1) % 6;
+ imageMap.URL = resourcePath + "gallery-" + imgIndex + ".jpg";
+ }
+
+ }
+ else
+ {
+ if (e.Key.KeyPressedName == "Up")
+ {
+ textMap2.PointSize = 14;
+ textMap2.TextColor = Color.Red;
+ textMap2.Text = "I'm happy!";
+ }
+
+ if (e.Key.KeyPressedName == "Down")
+ {
+ textMap2.PointSize = 17;
+ textMap2.TextColor = Color.Blue;
+ textMap2.Text = "I'm unhappy";
+ }
+ else if (e.Key.KeyPressedName == "Return")
+ {
+ imgIndex = (imgIndex + 1) % 6;
+ imageMap2.URL = resourcePath + "gallery-" + imgIndex + ".jpg";
+ }
+ }
+ }
+ return false;
+ }
+
+ private void Instance_Key(object sender, Stage.KeyEventArgs e)
+ {
+ View currentFocusView = FocusManager.Instance.GetCurrentFocusView();
+
+ Tizen.Log.Debug("NUI", "Stage_KeyEvent" + e.Key.State.ToString() + ", Pressed-" + e.Key.KeyPressedName);
+ //Tizen.Log.Debug("NUI", " CurrentFocusView : " + currentFocusView.HasBody() + currentFocusView?.Name);
+ }
+
+ private void VisualSample_FocusLost(object sender, EventArgs e)
+ {
+ VisualView view = sender as VisualView;
+ view.BackgroundColor = Color.Green;
+ view.Scale = new Vector3(1.0f, 1.0f, 1.0f);
+
+ view.AddVisual("iconVisual", dimImageMap);
+
+ if (view.Name == "MyView1")
+ {
+ imageMap2.MixColor = new Color(1, 0, 0, 0.5f);
+ imageMap2.Opacity = 0.5f;
+ }
+ else if (view.Name == "MyView0")
+ {
+ imageMap.MixColor = new Color(1, 0, 0, 0.5f);
+ imageMap.Opacity = 0.5f;
+ }
+
+ Tizen.Log.Debug("NUI", "FocusLost-" + view.Name);
+ }
+
+ private void VisualSample_FocusGained(object sender, EventArgs e)
+ {
+ VisualView view = sender as VisualView;
+ view.BackgroundColor = Color.Yellow;
+ view.Scale = new Vector3(1.2f, 1.2f, 1.0f);
+
+ view.AddVisual("iconVisual", highlightImageMap);
+
+ if (view.Name == "MyView1")
+ {
+ imageMap2.MixColor = new Color(1, 1, 1, 1);
+ imageMap2.Opacity = 1.0f;
+ }
+ else if (view.Name == "MyView0")
+ {
+ imageMap.MixColor = new Color(1, 1, 1, 1);
+ imageMap.Opacity = 1.0f;
+ }
+
+ Tizen.Log.Debug("NUI", "FocusGained-" + view.Name);
+ }
+
+ static void _Main(string[] args)
+ {
+ VisualSample sample = new VisualSample();
+ sample.Run(args);
+ }
+ }
+}
\ No newline at end of file
throw new System.Exception("second argument string property is invalid parameter!");
}
- //dynamic obj = (object)relativeValue;
PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
if (alphaFunction != null)
{
- AnimateBy(_prop, new PropertyValue(val), alphaFunction);
+ AnimateBy(_prop, val, alphaFunction);
}
else
{
- AnimateBy(_prop, new PropertyValue(val));
+ AnimateBy(_prop, val);
}
}
throw new System.Exception("second argument string property is invalid parameter!");
}
- //dynamic obj = (object)relativeValue;
PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
if (alphaFunction != null)
{
Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
- AnimateBy(_prop, new PropertyValue(val), alphaFunction, time);
+ AnimateBy(_prop, val, alphaFunction, time);
}
else
{
Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
- AnimateBy(_prop, new PropertyValue(val), time);
+ AnimateBy(_prop, val, time);
}
}
throw new System.Exception("second argument string property is invalid parameter!");
}
- //dynamic obj = (object)destinationValue;
PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
if (alphaFunction != null)
{
- AnimateTo(_prop, new PropertyValue(val), alphaFunction);
+ AnimateTo(_prop, val, alphaFunction);
}
else
{
- AnimateTo(_prop, new PropertyValue(val));
+ AnimateTo(_prop, val);
}
}
throw new System.Exception("second argument string property is invalid parameter!");
}
- //dynamic obj = (object)destinationValue;
PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
if (alphaFunction != null)
{
Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
- AnimateTo(_prop, new PropertyValue(val), alphaFunction, time);
+ AnimateTo(_prop, val, alphaFunction, time);
}
else
{
Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
- AnimateTo(_prop, new PropertyValue(val), time);
+ AnimateTo(_prop, val, time);
}
}
/// <param name="value">A value</param>
public void Add(float progress, object value)
{
- dynamic obj = value;
- Add(progress, new PropertyValue(obj));
+ PropertyValue val = PropertyValue.CreateFromObject(value);
+ Add(progress, val);
}
/// <summary>
/// <param name="alpha">The alpha function used to blend to the next keyframe</param>
public void Add(float progress, object value, AlphaFunction alpha)
{
- dynamic obj = value;
- Add(progress, new PropertyValue(obj), alpha);
+ PropertyValue val = PropertyValue.CreateFromObject(value);
+ Add(progress, val, alpha);
}
/// <summary>
System.Console.WriteLine(" got an Position property value ");
value = new PropertyValue((Position)obj);
}
+ else if (type.Equals(typeof(Position2D)))
+ {
+ System.Console.WriteLine(" got an Position2D property value ");
+ value = new PropertyValue((Position2D)obj);
+ }
else if (type.Equals(typeof(Size)))
{
System.Console.WriteLine(" got an Size property value ");
value = new PropertyValue((Size)obj);
}
+ else if (type.Equals(typeof(Size2D)))
+ {
+ System.Console.WriteLine(" got an Size2D property value ");
+ value = new PropertyValue((Size2D)obj);
+ }
else if (type.Equals(typeof(Color)))
{
System.Console.WriteLine(" got an Color property value ");
value = new PropertyValue((Color)obj);
}
+ else if (type.Equals(typeof(Rotation)))
+ {
+ System.Console.WriteLine(" got an Rotation property value ");
+ value = new PropertyValue((Rotation)obj);
+ }
+ else if (type.Equals(typeof(RelativeVector2)))
+ {
+ System.Console.WriteLine(" got an RelativeVector2 property value ");
+ value = new PropertyValue((RelativeVector2)obj);
+ }
+ else if (type.Equals(typeof(RelativeVector3)))
+ {
+ System.Console.WriteLine(" got an RelativeVector3 property value ");
+ value = new PropertyValue((RelativeVector3)obj);
+ }
+ else if (type.Equals(typeof(RelativeVector4)))
+ {
+ System.Console.WriteLine(" got an RelativeVector4 property value ");
+ value = new PropertyValue((RelativeVector4)obj);
+ }
else
{
- throw new global::System.InvalidOperationException("Unimplemented type for Property Value");
+ throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name);
}
return value;
}
private float _depthIndex = 0.0f;
protected PropertyMap _outputVisualMap = null;
+
internal string Name
{
set;
}
}
+ protected PropertyMap _shader = null;
+ //private PropertyMap _transform = null;
+ protected bool? _premultipliedAlpha = null;
+ protected Color _mixColor = null;
+ protected float? _opacity = null;
+ protected PropertyMap _commonlyUsedMap = null;
+
+ /// <summary>
+ /// The shader to use in the visual.
+ /// </summary>
+ public PropertyMap Shader
+ {
+ get
+ {
+ return _shader;
+ }
+ set
+ {
+ _shader = value;
+ UpdateVisual();
+ }
+ }
+ /// <summary>
+ /// Enables/disables premultiplied alpha. <br>
+ /// The premultiplied alpha is false by default unless this behaviour is modified by the derived Visual type.
+ /// </summary>
+ public bool PremultipliedAlpha
+ {
+ get
+ {
+ return _premultipliedAlpha??false;
+ }
+ set
+ {
+ _premultipliedAlpha = value;
+ UpdateVisual();
+ }
+ }
+ /// <summary>
+ /// Mix color is a blend color for any visual.
+ /// </summary>
+ public Color MixColor
+ {
+ get
+ {
+ return _mixColor;
+ }
+ set
+ {
+ _mixColor = value;
+ UpdateVisual();
+ }
+ }
+ /// <summary>
+ /// Opacity is the alpha component of the mixColor, above.
+ /// </summary>
+ public float Opacity
+ {
+ get
+ {
+ return _opacity??(-1.0f);
+ }
+ set
+ {
+ _opacity = value;
+ UpdateVisual();
+ }
+ }
+
}
/// <summary>
if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
-
}
/// <summary>
if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
}
if (_color != null) { _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color)); }
if (_size != null) { _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size)); }
if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
}
{
}
- private Color _mixColor = null;
+ private Color _mixColorForColorVisual = null;
/// <summary>
/// Get or set the solid color required.
/// </summary>
- public Color MixColor
+ public Color Color
{
get
{
- return _mixColor;
+ return _mixColorForColorVisual;
}
set
{
- _mixColor = value;
+ _mixColorForColorVisual = value;
UpdateVisual();
}
}
{
_outputVisualMap = new PropertyMap();
_outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
- if (_mixColor != null) { _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColor)); }
+ if (_mixColorForColorVisual != null) { _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
}
if (_stopColor != null) { _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor)); }
if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
}
if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+
}
}
}
private PrimitiveVisualShapeType? _shape = null;
- private Color _mixColor = null;
+ private Color _mixColorForPrimitiveVisual = null;
private int? _slices = null;
private int? _stacks = null;
private float? _scaleTopRadius = null;
{
get
{
- return _mixColor;
+ return _mixColorForPrimitiveVisual;
}
set
{
- _mixColor = value;
+ _mixColorForPrimitiveVisual = value;
UpdateVisual();
}
}
_outputVisualMap = new PropertyMap(); ;
_outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
- if (_mixColor != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColor)); }
+ if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
}
if (_url != null) { _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url)); }
if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+
}
}
public static readonly int Transform = NDalic.VISUAL_PROPERTY_TRANSFORM;
public static readonly int PremultipliedAlpha = NDalic.VISUAL_PROPERTY_PREMULTIPLIED_ALPHA;
public static readonly int MixColor = NDalic.VISUAL_PROPERTY_MIX_COLOR;
+ public static readonly int Opacity = NDalic.VISUAL_PROPERTY_MIX_COLOR + 1;
}
/// <summary>
_outputVisualMap = new PropertyMap();
_outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
if (_url != null) { _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
}
_outputVisualMap = new PropertyMap();
_outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
if (_url != null) { _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url)); }
+ if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
+ if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
+ if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
+ if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
}
}
string _str1 = _propertyIndex.Substring(0, 1);
string _str2 = _propertyIndex.Substring(1);
string _str = _str1.ToLower() + _str2;
-
- //dynamic _obj = (object)_destinationValue;
+
PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
PropertyMap _transition = new PropertyMap();
_transition.Add("target", new PropertyValue(_target));
_transition.Add("property", new PropertyValue(_str));
- _transition.Add("targetValue", new PropertyValue(val));
+ _transition.Add("targetValue", val);
_transition.Add("animator", new PropertyValue(_animator));
_outputVisualMap = _transition;