本文整理汇总了C#中ZeldaOracle.Common.Geometry.Point2I类的典型用法代码示例。如果您正苦于以下问题:C# Point2I类的具体用法?C# Point2I怎么用?C# Point2I使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point2I类属于ZeldaOracle.Common.Geometry命名空间,在下文中一共展示了Point2I类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectibleReward
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public CollectibleReward(Reward reward, bool isDrop = false)
{
this.reward = reward;
this.showMessage = !reward.OnlyShowMessageInChest;
this.hasDuration = reward.HasDuration;
this.isCollectibleWithItems = reward.IsCollectibleWithItems;
this.isDrop = isDrop;
// Physics.
Physics.CollisionBox = new Rectangle2I(-4, -9, 8, 8);
Physics.SoftCollisionBox = new Rectangle2I(-5, -9, 9, 8);
EnablePhysics(
PhysicsFlags.Bounces |
PhysicsFlags.HasGravity |
PhysicsFlags.CollideRoomEdge |
PhysicsFlags.CollideWorld |
PhysicsFlags.HalfSolidPassable |
PhysicsFlags.DestroyedInHoles);
soundBounce = reward.BounceSound;
// Graphics.
centerOffset = new Point2I(0, -5);
Graphics.DrawOffset = new Point2I(-8, -13);
Graphics.RipplesDrawOffset = new Point2I(0, 1);
Graphics.IsGrassEffectVisible = true;
Graphics.IsRipplesEffectVisible = true;
}
示例2: BaseTileData
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public BaseTileData()
{
name = "";
type = null;
tileset = null;
sheetLocation = Point2I.Zero;
properties = new Properties(this);
events = new ObjectEventCollection();
properties.Set("id", "");
properties.SetDocumentation("id", "ID", "", "", "General",
"The id used to refer to this tile.");
properties.Set("enabled", true);
properties.SetDocumentation("enabled", "Enabled", "", "", "General",
"True if the tile is spawned upon entering the room.");
properties.Set("sprite_index", 0);
properties.SetDocumentation("sprite_index", "Sprite Index", "sprite_index", "", "Internal",
"The current sprite in the sprite list to draw.");
properties.Set("substrip_index", 0);
properties.SetDocumentation("substrip_index", "Animation Substrip Index", "", "", "Internal",
"The index of the substrip for dynamic animations.", true, true);
}
示例3: SpriteSheet
public SpriteSheet(Image image, int cellWidth, int cellHeight, int offsetX, int offsetY, int spacingX, int spacingY)
{
this.image = image;
this.cellSize = new Point2I(cellWidth, cellHeight);
this.offset = new Point2I(offsetX, offsetY);
this.spacing = new Point2I(spacingX, spacingY);
}
示例4: Sprite
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public Sprite()
{
this.image = null;
this.sourceRect = Rectangle2I.Zero;
this.drawOffset = Point2I.Zero;
this.nextPart = null;
}
示例5: DrawSprite
// Draws the item inside the inventory.
protected override void DrawSprite(Graphics2D g, Point2I position, int lightOrDark)
{
Sprite spr = sprite[level];
if (inventory.IsWeaponEquipped(this) && spriteEquipped != null)
spr = spriteEquipped[level];
g.DrawSprite(spr, lightOrDark, position);
}
示例6: Level
public Level(string name, int width, int height, int layerCount, Point2I roomSize, Zone zone)
{
this.world = null;
this.roomSize = roomSize;
this.roomLayerCount = layerCount;
this.dimensions = Point2I.Zero;
//this.zone = zone;
properties = new Properties(this);
properties.BaseProperties = new Properties();
properties.BaseProperties.Set("id", "")
.SetDocumentation("ID", "", "", "", "The id used to refer to this level.", false, true);
properties.BaseProperties.Set("dungeon", "")
.SetDocumentation("Dungeon", "dungeon", "", "", "The dungeon this level belongs to.");
properties.BaseProperties.Set("dungeon_floor", 0)
.SetDocumentation("Dungeon Floor", "", "", "", "The floor in the dungeon this level belongs to.");
properties.BaseProperties.Set("discovered", false);
properties.Set("id", name);
properties.BaseProperties.Set("zone", "")
.SetDocumentation("Zone", "zone", "", "", "The zone type for this room.", true, false);
Zone = zone;
Resize(new Point2I(width, height));
}
示例7: DrawSprite
// Draws the item inside the inventory.
protected override void DrawSprite(Graphics2D g, Point2I position, int lightOrDark)
{
Sprite spr = sprite[level];
if (spriteEquipped != null)
spr = spriteEquipped[level];
g.DrawSprite(isEquipped ? spr : sprite[level], lightOrDark, position);
}
示例8: DungeonMapFloor
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
public DungeonMapFloor(DungeonFloor dungeonFloor)
{
this.dungeonFloor = dungeonFloor;
this.floorNumber = dungeonFloor.FloorNumber;
this.isDiscovered = dungeonFloor.IsDiscovered;
this.size = new Point2I(8, 8);
// Create rooms.
rooms = new DungeonMapRoom[size.X, size.Y];
isBossFloor = false;
if (dungeonFloor.Level != null) {
for (int x = 0; x < size.X; x++) {
for (int y = 0; y < size.Y; y++) {
Point2I loc = new Point2I(x, y);
if (dungeonFloor.Level.ContainsRoom(loc)) {
Room room = dungeonFloor.Level.GetRoomAt(loc);
if (!room.IsHiddenFromMap) {
rooms[x, y] = DungeonMapRoom.Create(room, this);
if (rooms[x, y] != null && rooms[x, y].IsBossRoom)
isBossFloor = true;
}
}
else
rooms[x, y] = null;
}
}
}
}
示例9: MonsterBeetle
public MonsterBeetle()
{
// General.
MaxHealth = 1;
ContactDamage = 1;
color = MonsterColor.Green;
// Movement.
moveSpeed = 0.5f;
//numMoveAngles = 8;
//isMovementDirectionBased = true;
changeDirectionsOnCollide = true;
movesInAir = false;
stopTime.Set(0, 0);
moveTime.Set(50, 80);
// Physics.
Physics.Bounces = true; // This is here for when the monster is digged up or dropped from the ceiling.
Physics.ReboundRoomEdge = true;
Physics.ReboundSolid = true;
// Graphics.
animationMove = GameData.ANIM_MONSTER_BEETLE;
Graphics.DrawOffset = new Point2I(-8, -14) + new Point2I(0, 3);
centerOffset = new Point2I(0, -6) + new Point2I(0, 3);
syncAnimationWithDirection = true;
// Interactions.
SetReaction(InteractionType.SwitchHook, SenderReactions.Intercept, Reactions.Damage);
}
示例10: DrawSprite
public static void DrawSprite(Graphics g, SpriteAnimation sprite, int variantID, Point2I position, Point2I sourceSize)
{
if (sprite.IsAnimation)
DrawSprite(g, sprite.Animation.GetFrameAsSprite(0), variantID, position.X, position.Y, sourceSize.X, sourceSize.Y);
else
DrawSprite(g, sprite.Sprite, variantID, position.X, position.Y, sourceSize.X, sourceSize.Y);
}
示例11: Seed
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public Seed(SeedType type)
{
this.type = type;
// Flags for seed's dropped from satchel
EnablePhysics(
PhysicsFlags.HasGravity |
PhysicsFlags.DestroyedOutsideRoom |
PhysicsFlags.DestroyedInHoles);
/*
// Flags for seed Projectiles
EnablePhysics(
PhysicsFlags.DestroyedOutsideRoom |
PhysicsFlags.CollideWorld |
PhysicsFlags.ReboundSolid |
PhysicsFlags.HalfSolidPassable |
PhysicsFlags.LedgePassable);
*/
Physics.CollisionBox = new Rectangle2F(-1, -1, 2, 2);
Physics.SoftCollisionBox = new Rectangle2F(-1, -1, 2, 2);
graphics.DrawOffset = new Point2I(-4, -6);
centerOffset = new Point2I(0, -2);
}
示例12: EventTileDataInstance
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public EventTileDataInstance()
{
this.room = null;
this.position = Point2I.Zero;
this.data = null;
this.modifiedProperties = new Properties();
this.modifiedProperties.PropertyObject = this;
}
示例13: OnMouseDragMove
public override void OnMouseDragMove(MouseEventArgs e)
{
Point2I mousePos = new Point2I(e.X, e.Y);
Room room = LevelDisplayControl.SampleRoom(mousePos);
Point2I tileCoord = LevelDisplayControl.SampleTileCoordinates(mousePos);
if (room != null)
ActivateTile(e.Button, room, tileCoord);
}
示例14: SpawnCollectibleFromBreakableTile
//-----------------------------------------------------------------------------
// Rewards
//-----------------------------------------------------------------------------
public Collectible SpawnCollectibleFromBreakableTile(Reward reward, Point2I position)
{
Collectible collectible = new Collectible(reward);
gameControl.RoomControl.SpawnEntity(collectible);
collectible.Position = position;
collectible.Physics.ZVelocity = 1.5f;
return collectible;
}
示例15: AddSlot
//-----------------------------------------------------------------------------
// Slots
//-----------------------------------------------------------------------------
// Adds the slot to the slot group.
public Slot AddSlot(Point2I position, int width)
{
Slot slot = new Slot(this, position, width);
slots.Add(slot);
if (slots.Count == 1)
currentSlot = slot;
return slot;
}