Ejemplo n.º 1
0
        public void Render(ItemTransform pTransform, DrawingContext2D dc)
        {
            if (!Visible)
            {
                return;
            }

            switch (_character)
            {
            case Shape s:
                var geometry = _context.GetGeometry(s.Geometry, _character);
                AptRenderer.RenderGeometry(dc, _context, geometry, pTransform);
                break;

            case Text t:
                if (t.Value.Length > 0)
                {
                    var val = ScriptObject.ResolveValue(t.Value, ScriptObject);
                    if (val.Type != ValueType.Undefined)
                    {
                        t.Content = val.ToString();
                    }
                }

                //localize our content
                t.Content = t.Content.Replace("$", "APT:");
                t.Content = _context.ContentManager.TranslationManager.Lookup(t.Content);

                AptRenderer.RenderText(dc, _context, t, pTransform);
                break;
            }
        }
Ejemplo n.º 2
0
        public override void Render(AptRenderer renderer, ItemTransform pTransform, DrawingContext2D dc)
        {
            if (!Visible)
            {
                return;
            }

            var cTransform = pTransform * Transform;

            switch (Character)
            {
            case Shape s:
                var geometry = Context.GetGeometry(s.Geometry, Character);

                renderer.RenderGeometry(dc, Context, geometry, cTransform, Texture);
                break;

            case Text t:
                if (t.Value.Length > 0)
                {
                    var val = ScriptObject.ResolveValue(t.Value, ScriptObject);
                    if (val.Type != ValueType.Undefined)
                    {
                        t.Content = val.ToString();
                    }
                }

                //localize our content
                t.Content = t.Content.Replace("$", "APT:");
                t.Content = t.Content.Translate();

                renderer.RenderText(dc, Context, t, cTransform);
                break;
            }
        }