本文整理汇总了C#中IDrawable类的典型用法代码示例。如果您正苦于以下问题:C# IDrawable类的具体用法?C# IDrawable怎么用?C# IDrawable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDrawable类属于命名空间,在下文中一共展示了IDrawable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: BeamRenderer
public BeamRenderer(int count, IDrawable part, Vector3 dist)
{
Count = count;
Part = part;
Distance = dist;
Offset = Matrix4Extensions.FromTranslation(Distance);
}
示例3: GlListDrawable
public GlListDrawable(IDrawable drawable)
{
if (drawable == null) { throw new ArgumentNullException("drawable"); }
this.refresh = -1;
this.drawable = drawable;
this.bufferedDrawable = drawable as BufferedDrawable;
}
示例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);
}
示例5: TileDrawable
/// <summary>
/// Constructs the tile drawable object.
/// </summary>
public TileDrawable(
Tile tile,
IDrawable drawable)
{
this.tile = tile;
this.drawable = drawable;
}
示例6: Add
public void Add(IDrawable drawable)
{
if (drawable == null) throw new ArgumentNullException("drawable");
lock (_drawingsSync) {
_grpdrawings.Add(drawable);
}
}
示例7: remove
public IDrawable remove(IDrawable d)
{
bool removed=myDrawables.Remove(d);
if (index >= myDrawables.Count)
index = 0;
return removed?d:null;
}
示例8: Drawable
public Drawable(Generator g)
: base(g, typeof(IDrawable), false)
{
inner = (IDrawable)Handler;
inner.Create ();
Initialize ();
}
示例9: Computer
public Computer(CPU cpu, RAM ram, HardDriver hardDriver, IDrawable videoCard)
{
this.CPU = cpu;
this.RAM = ram;
this.HardDrives = hardDriver;
this.VideoCard = videoCard;
}
示例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;
}
示例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);
}
示例12: unregister
public bool unregister(IDrawable component)
{
if (isRegistered(component)) {
list.Remove(component);
return true;
}
return false;
}
示例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;
}
示例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;
}
示例15: SetParameters
public virtual void SetParameters(IDrawable a_renderable)
{
if (SetUserParameters != null)
{
SetUserParameters(BackingEffect, a_renderable);
}
BackingEffect.CommitChanges();
}