本文整理汇总了C#中SFML.Graphics.View.Zoom方法的典型用法代码示例。如果您正苦于以下问题:C# View.Zoom方法的具体用法?C# View.Zoom怎么用?C# View.Zoom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFML.Graphics.View
的用法示例。
在下文中一共展示了View.Zoom方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public override void Init(Entity entity)
{
base.Init(entity);
camera = new View(Target.Transform.Position, Global.Screen);
camera.Zoom(2f);
//camera.Rotate(45f);
}
示例2: Initialize
public void Initialize()
{
world = (LayeredWorld)WorldManager.Worlds["first_world"];
view = new View(new Vector2f(100, 0), new Vector2f(50, 50));
view.Zoom(10);
player = new Player(world.PlayerStartPosition);
Program.RenderWindow.KeyPressed += RenderWindow_KeyPressed;
}
示例3: draw
public void draw(RenderWindow win, View view)
{
if (resetView)
{
view.Center = Vector2.Zero;
view.Zoom(100F / view.Size.Y);
resetView = false;
}
win.Draw(bg);
Map.Draw(win);
AlignmentManager.Draw(win);
ParticleManager.Draw(win);
EnemyManager.Draw(win);
Player.Draw(win);
}
示例4: RefreshView
void RefreshView()
{
View v = new View(new FloatRect(cameraX, cameraY, Width, Height));
v.Rotation = -cameraAngle;
v.Zoom(1 / cameraZoom);
RenderTarget.SetView(v);
}
示例5: SfmlControl_Resize
void SfmlControl_Resize(object sender, EventArgs e)
{
Vector2f size = new Vector2f(1920f, 1080f);
SFML.Graphics.View v = new SFML.Graphics.View(m_currentViewPosition, size);
v.Zoom(m_currentZoom);
float windowRatio = (float)this.Size.Width / (float)this.Size.Height;
float viewRatio = 16f / 9f;
float sizeX = 1f;
float sizeY = 1f;
float posX = 0f;
float posY = 0f;
bool horizontalSpacing = (windowRatio > viewRatio);
if (horizontalSpacing)
{
sizeX = viewRatio / windowRatio;
posX = (1f - sizeX) / 2f;
}
else
{
sizeY = windowRatio / viewRatio;
posY = (1f - sizeY) / 2f;
}
v.Viewport = new FloatRect(posX, posY, sizeX, sizeY);
m_renderWindow.SetView(v);
}
示例6: UpdateDraw
private static void UpdateDraw(RenderWindow window)
{
cameraPos = new Vector2f((int)clientPlayer.position.X, (int)clientPlayer.position.Y);
camera2D = new View(cameraPos, new Vector2f(640, 480));
camera2D.Zoom(.5f);
View noCamera = new View(new Vector2f(0, 0), new Vector2f(640, 480));
window.SetView(camera2D);
UpdateSounds();
window.DispatchEvents();
window.Clear(Color.Black);
for (int i = 0; i < connectedPlayers.Count; i++)
{
connectedPlayers[i].connectColor = Color.White;
}
//window.Draw(background);
window.Draw(basicLevelDec);
HandleMessages();
Text _chatCompose = new Text(clientPlayer.textCapture, font);
float chatScale = .4f;
_chatCompose.Scale = new Vector2f(chatScale, chatScale);
_chatCompose.Position = new Vector2f(-300, 200);// clientPlayer.position;
Text _textConnected = new Text(connected ? "CONNECTED" : "DISCONNECTED", font);
_textConnected.Scale = new Vector2f(chatScale, chatScale);
_textConnected.Position = new Vector2f(-300, -230);// clientPlayer.position;
Text _playersConnectedText = new Text(connectedPlayers.Count + " Player Connected", font);
_playersConnectedText.Scale = new Vector2f(chatScale, chatScale);
_playersConnectedText.Position = new Vector2f(-300, -220);// clientPlayer.position;
drawPlayers();
updatePlayers();
window.SetView(noCamera);
window.Draw(_chatCompose);
window.Draw(_textConnected);
window.Draw(_playersConnectedText);
Color pingColor = Color.White;
if (ping == 0)
{
//connected = false;
pingColor = Color.Red;
}
if (ping > 100)
{
pingColor = Color.Yellow;
}
Render.drawString(font, ping + " ms", new Vector2f(-300, -240), pingColor, .4f, false);
for (int i = 0; i < chatMessages.Count; i++)
{
Text chatMessage = new Text(chatMessages[i], font);
chatMessage.Scale = new Vector2f(chatScale, chatScale);
chatMessage.Position = new Vector2f(-300, -200 + (i * 10));// clientPlayer.position;
window.Draw(chatMessage);
}
window.Display();
}
示例7: CameraManager
public CameraManager(Game game)
{
_game = game;
_worldView = new View(new Vector2f(0, 0), new Vector2f(800, 600));
_worldView.Zoom(1f / 32f);
}
示例8: CameraSystem
public CameraSystem()
{
_worldView = new View(new Vector2f(0, 0), new Vector2f(Game.window.DefaultView.Size.X, Game.window.DefaultView.Size.Y));
_worldView.Zoom(1f / ORIGINAL_SCALE);
}