本文整理汇总了C#中ZeldaOracle.Common.Geometry.Point2I类的典型用法代码示例。如果您正苦于以下问题:C# Point2I类的具体用法?C# Point2I怎么用?C# Point2I使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point2I类属于ZeldaOracle.Common.Geometry命名空间,在下文中一共展示了Point2I类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:30,代码来源:CollectibleReward.cs
示例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);
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:28,代码来源:BaseTileData.cs
示例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);
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:7,代码来源:SpriteSheet.cs
示例4: Sprite
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public Sprite()
{
this.image = null;
this.sourceRect = Rectangle2I.Zero;
this.drawOffset = Point2I.Zero;
this.nextPart = null;
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:10,代码来源:Sprite.cs
示例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);
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:8,代码来源:ItemEquipment.cs
示例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));
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:30,代码来源:Level.cs
示例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);
}
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:8,代码来源:ItemEquipment.cs
示例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;
}
}
}
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:32,代码来源:DungeonMapFloor.cs
示例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);
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:30,代码来源:MonsterBeetle.cs
示例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);
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:7,代码来源:EditorGraphics.cs
示例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);
}
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:28,代码来源:Seed.cs
示例12: EventTileDataInstance
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public EventTileDataInstance()
{
this.room = null;
this.position = Point2I.Zero;
this.data = null;
this.modifiedProperties = new Properties();
this.modifiedProperties.PropertyObject = this;
}
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:11,代码来源:EventTileDataInstance.cs
示例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);
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:8,代码来源:ToolEyedrop.cs
示例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;
}
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:11,代码来源:RewardManager.cs
示例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;
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:12,代码来源:SlotGroup.cs
示例16: OnMouseDown
public override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
Point2I mousePos = new Point2I(e.X, e.Y);
Room room = LevelDisplayControl.SampleRoom(mousePos);
Point2I tileCoord = LevelDisplayControl.SampleTileCoordinates(mousePos);
if (EditorControl.EventMode) {
if (EditorControl.EventMode && e.Button == MouseButtons.Left) {
//EventTileData eventTile = Resources.GetResource<EventTileData>("warp");
EventTileData eventTile = Resources.GetResource<EventTileData>("npc");
//Point2I mousePos = new Point2I(e.X, e.Y);
//Room room = LevelDisplayControl.SampleRoom(mousePos);
if (room != null) {
Point2I roomPos = LevelDisplayControl.GetRoomDrawPosition(room);
Point2I pos = (mousePos - roomPos) / 8;
pos *= 8;
//Point2I tileCoord = LevelDisplayControl.SampleTileCoordinates(mousePos);
room.CreateEventTile(eventTile, pos);
}
}
else if (EditorControl.EventMode && e.Button == MouseButtons.Right) {
EventTileDataInstance eventTile = LevelDisplayControl.SampleEventTile(new Point2I(e.X, e.Y));
if (eventTile != null) {
eventTile.Room.RemoveEventTile(eventTile);
}
}
else if (e.Button == MouseButtons.Middle) {
// Select events.
EventTileDataInstance selectedEventTile = LevelDisplayControl.SampleEventTile(mousePos);
if (selectedEventTile != null) {
Point2I levelTileCoord = LevelDisplayControl.ToLevelTileCoordinates(room, tileCoord);
EditorControl.PropertyGridControl.OpenProperties(selectedEventTile.Properties, selectedEventTile);
}
else {
EditorControl.PropertyGridControl.CloseProperties();
}
}
}
else {
if (e.Button == MouseButtons.Middle) {
// Select tiles.
TileDataInstance selectedTile = room.GetTile(tileCoord, editorControl.CurrentLayer);
if (selectedTile != null) {
Point2I levelTileCoord = LevelDisplayControl.ToLevelTileCoordinates(room, tileCoord);
EditorControl.PropertyGridControl.OpenProperties(selectedTile.Properties, selectedTile);
}
else {
EditorControl.PropertyGridControl.CloseProperties();
}
}
}
}
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:58,代码来源:ToolPlace.cs
示例17: TileGrid
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
public TileGrid(Point2I size, int layerCount)
{
this.size = size;
this.layerCount = layerCount;
this.tiles = new TileGridTile[size.X, size.Y, layerCount];
this.eventTiles = new List<EventTileDataInstance>();
Clear();
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:12,代码来源:TileGrid.cs
示例18: Unit
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public Unit()
{
EnablePhysics();
health = 1;
healthMax = 1;
direction = Directions.Right;
centerOffset = new Point2I(8, 8);
}
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:12,代码来源:Unit.cs
示例19: TileDataInstance
//-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
public TileDataInstance()
{
this.room = null;
this.location = Point2I.Zero;
this.layer = 0;
this.tileData = null;
this.properties = new Properties();
this.properties.PropertyObject = this;
}
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:12,代码来源:TileDataInstance.cs
示例20: Slot
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
public Slot(SlotGroup group, Point2I position, int width)
{
this.group = group;
this.position = position;
this.width = width;
this.connections = new ISlotConnection[4];
this.item = null;
this.disabled = false;
}
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:12,代码来源:Slot.cs
注:本文中的ZeldaOracle.Common.Geometry.Point2I类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论