• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDrawable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IDrawable的典型用法代码示例。如果您正苦于以下问题:C# IDrawable类的具体用法?C# IDrawable怎么用?C# IDrawable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDrawable类属于命名空间,在下文中一共展示了IDrawable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Draw

 /// <summary>
 /// Draws out the particle with the given drawable at the
 /// particle's position.
 /// </summary>
 public void Draw(IDrawable drawable, DrawingArgs args)
 {
     double ratio = secondsRemaining / Constants.MaxSwarmParticleLife;
     Color c = Color.FromArgb((int) (ratio * 255.0), Color.White);
     PointF p = new PointF(CurrentX, CurrentY);
     drawable.Draw(p, c, args.BackendDrawingArgs);
 }
开发者ID:dmoonfire,项目名称:cutegod,代码行数:11,代码来源:SwarmParticle.cs


示例2: BeamRenderer

 public BeamRenderer(int count, IDrawable part, Vector3 dist)
 {
     Count = count;
     Part = part;
     Distance = dist;
     Offset = Matrix4Extensions.FromTranslation(Distance);
 }
开发者ID:cody82,项目名称:spacewar-arena,代码行数:7,代码来源:effects.cs


示例3: GlListDrawable

 public GlListDrawable(IDrawable drawable)
 {
     if (drawable == null) { throw new ArgumentNullException("drawable"); }
     this.refresh = -1;
     this.drawable = drawable;
     this.bufferedDrawable = drawable as BufferedDrawable;
 }
开发者ID:timdetering,项目名称:Physics2D.Net,代码行数:7,代码来源:GlListDrawable.cs


示例4: AddObject

 internal static void AddObject (IDrawable obj)
 {
     var client = CallContext.Client;
     if (!objects.ContainsKey (client))
         objects [client] = new List<IDrawable> ();
     objects [client].Add (obj);
 }
开发者ID:paperclip,项目名称:krpc,代码行数:7,代码来源:Addon.cs


示例5: TileDrawable

        /// <summary>
        /// Constructs the tile drawable object.
        /// </summary>
        public TileDrawable(
			Tile tile,
			IDrawable drawable)
        {
            this.tile = tile;
            this.drawable = drawable;
        }
开发者ID:dmoonfire,项目名称:wordplay,代码行数:10,代码来源:TileDrawable.cs


示例6: Add

 public void Add(IDrawable drawable)
 {
     if (drawable == null) throw new ArgumentNullException("drawable"); 
     lock (_drawingsSync) {
         _grpdrawings.Add(drawable);
     }
 }
开发者ID:ElderByte-,项目名称:Archimedes.Geometry,代码行数:7,代码来源:DrawingGroup.cs


示例7: remove

 public IDrawable remove(IDrawable d)
 {
     bool removed=myDrawables.Remove(d);
     if (index >= myDrawables.Count)
         index = 0;
     return removed?d:null;
 }
开发者ID:jjaspe,项目名称:Libraries,代码行数:7,代码来源:World.cs


示例8: Drawable

 public Drawable(Generator g)
     : base(g, typeof(IDrawable), false)
 {
     inner = (IDrawable)Handler;
     inner.Create ();
     Initialize ();
 }
开发者ID:M1C,项目名称:Eto,代码行数:7,代码来源:Drawable.cs


示例9: Computer

 public Computer(CPU cpu, RAM ram, HardDriver hardDriver, IDrawable videoCard)
 {
     this.CPU = cpu;
     this.RAM = ram;
     this.HardDrives = hardDriver;
     this.VideoCard = videoCard;
  }
开发者ID:damy90,项目名称:Telerik-all,代码行数:7,代码来源:Computer.cs


示例10: IntersectWith

        public Direction IntersectWith(IDrawable obj)
        {
            if ((this.Position.Left > obj.Position.Left && this.Position.Left < obj.Position.Left + obj.Size.Width)
                || (this.Position.Left + this.Size.Width > obj.Position.Left && this.Position.Left + this.Size.Width < obj.Position.Left + obj.Size.Width)
                || (this.Position.Left == obj.Position.Left && this.Position.Left + this.Size.Width == obj.Position.Left + obj.Size.Width))
            {
                if (this.Position.Top + this.Size.Height >= obj.Position.Top && this.Position.Top + this.Size.Height < obj.Position.Top + obj.Size.Height)
                {
                    return Direction.Down;
                }

                if (this.Position.Top <= obj.Position.Top + obj.Size.Height && this.Position.Top > obj.Position.Top)
                {
                    return Direction.Up;
                }
            }

            if ((this.Position.Top > obj.Position.Top && this.Position.Top < obj.Position.Top + obj.Size.Height)
                || (this.Position.Top + this.Size.Height > obj.Position.Top && this.Position.Top + this.Size.Height < obj.Position.Top + obj.Size.Height)
                || (this.Position.Top == obj.Position.Top && this.Position.Top + this.Size.Height == obj.Position.Top + obj.Size.Height))
            {
                if (this.Position.Left <= obj.Position.Left + obj.Size.Width && this.Position.Left > obj.Position.Left)
                {
                    return Direction.Left;
                }

                if (this.Position.Left + this.Size.Width >= obj.Position.Left && this.Position.Left + this.Size.Width < obj.Position.Left + obj.Size.Width)
                {
                    return Direction.Right;
                }
            }

            return Direction.None;
        }
开发者ID:plmng,项目名称:SoftUni_OOP_HWs,代码行数:34,代码来源:GameObject.cs


示例11: RemoveObject

 internal static void RemoveObject (IDrawable obj)
 {
     var client = CallContext.Client;
     if (!objects.ContainsKey (client) || !objects [client].Contains (obj))
         throw new ArgumentException ("Drawing object not found");
     obj.Destroy ();
     objects [client].Remove (obj);
 }
开发者ID:paperclip,项目名称:krpc,代码行数:8,代码来源:Addon.cs


示例12: unregister

 public bool unregister(IDrawable component)
 {
     if (isRegistered(component)) {
         list.Remove(component);
         return true;
     }
     return false;
 }
开发者ID:rpfypust,项目名称:RealisticPerspective,代码行数:8,代码来源:GUIManager.cs


示例13: Image

		public Image( IDrawable drawable, Scaling scaling = Scaling.Stretch, int align = AlignInternal.center )
		{
			setDrawable( drawable );
			_scaling = scaling;
			_align = align;
			setSize( preferredWidth, preferredHeight );
			touchable = Touchable.Disabled;
		}
开发者ID:RastaCow,项目名称:Nez,代码行数:8,代码来源:Image.cs


示例14: register

 public bool register(IDrawable component)
 {
     if (!isRegistered(component)) {
         list.Add(component);
         list.Sort((x, y) => priority(x).CompareTo(priority(y)));
         return true;
     }
     return false;
 }
开发者ID:rpfypust,项目名称:RealisticPerspective,代码行数:9,代码来源:GUIManager.cs


示例15: SetParameters

        public virtual void SetParameters(IDrawable a_renderable)
        {
            if (SetUserParameters != null)
            {
                SetUserParameters(BackingEffect, a_renderable);
            }

            BackingEffect.CommitChanges();
        }
开发者ID:kirlianstudios,项目名称:armada,代码行数:9,代码来源:Effect.cs


示例16: RemoveFromDraw

        /// <summary>
        /// Poistaa olion, kun kerrosta ei tunneta.
        /// Käy läpi kaikki kerrokset, kunnes olio löytyy.
        /// </summary>
        /// <param name="obj">Poistettava olio.</param>
        /// <returns></returns>
        public static bool RemoveFromDraw(IDrawable obj)
        {
            for (int i = 0; i < Layers.Length; i++)
            {
                if (Layers[i].objectsOnLayer.Remove(obj))
                    return true;
            }

            return false;
        }
开发者ID:Mistrator,项目名称:Augenblick,代码行数:16,代码来源:Layer.cs


示例17: Asteroid

        public Asteroid(float radius, IDrawable model)
        {
            Draw = new ArrayList();

            Draw.Add(model);
            Radius = radius;
            RenderRadius = Radius;

            Hull = new Hull(1000);
        }
开发者ID:cody82,项目名称:spacewar-arena,代码行数:10,代码来源:planets.cs


示例18: run

        IDrawable run(IDrawable input)
        {
            if (!(input is CircleSet))
            {
                throw new Exception("CircleTest. Input is not Circles.");
            }

            var inp = input as CircleSet;

            Circle a = inp[0];
            Circle b = inp[1];

            bool x = Intersect.IsIntersected(a,b);
            if (x) return DrawableElement.Text(0, 0, "Vse horosho");
            else return DrawableElement.Text(0, 0, "Vse ploho");
        }
开发者ID:anhlehoang410,项目名称:Game-5,代码行数:16,代码来源:CircleTest.cs


示例19: Draw

        public static void Draw(IDrawable drawling)
        {
            if (drawling.Texture == null)
                return;

            Color color =
                (drawling.Transparent) ? Color.Transparent : drawling.Color;

            if (drawling.SourceRectangle != Rectangle.Empty && drawling.SourceRectangle != null)
            {
                DrawWithSourceRect(drawling);
                return;
            }
            if (drawling.Visible)
                spriteBatch.Draw(drawling.Texture, drawling.Rectangle, color );
        }
开发者ID:dajuanrobins,项目名称:XNA-Game-Library,代码行数:16,代码来源:DrawStuff.cs


示例20: priority

 private int priority(IDrawable idrawable)
 {
     if (idrawable.GetType() == typeof(Player)
         || idrawable.GetType() == typeof(DummyBoss)
         || idrawable.GetType() == typeof(Boss)) {
         return 0;
     } else if (idrawable.GetType() == typeof(HUD)) {
         return 1;
     } else if (idrawable.GetType() == typeof(Fader)) {
         return 2;
     } else if (idrawable.GetType() == typeof(PauseScreen)) {
         return 4;
     } else {
         return 3;
     }
 }
开发者ID:rpfypust,项目名称:RealisticPerspective,代码行数:16,代码来源:GUIManager.cs



注:本文中的IDrawable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDrawableContainer类代码示例发布时间:2022-05-24
下一篇:
C# IDrawDevice类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap