Questions tagged [sfml.net]

.Net wrapper for the Simple Fast Multimedia Library.

30 questions
0
votes
0 answers

NullReferenceException when accessing an array of Rectangle Shapes

I'm struggling to understand why accessing an object in this array throws a NullReferenceException. I initialized the array right beforehand, so what's trying to be referenced should exist. parent.rowlength and parent.collength are the size of an…
MachCoyote
  • 11
  • 4
0
votes
1 answer

Placing object based on different variables

I am making a game library using SFML.Net, and I want to be able to place a 50x50 tile onto the screen. I have the Window width, the Window height, the MouseX/MouseY, and an offset based on a custom camera. When WASD is pressed, the offset is…
user11494366
0
votes
1 answer

Otter - text rendering not works

I made method,that draws text using Otter(2D Game Rendering Library using SFML.NET).But method not works correct,text not rendered. Code: public static void DrawText(string Text,string Font,int Size,VXG_Color …
Byte
  • 55
  • 11
0
votes
1 answer

How to prevent automatic scaling of my Image drawn inside a RenderWindow?

I am using SFML.Net 2.4 with C# I have a RenderWindow of size 1000x1000 inserted into a System.Windows.Forms.Form this way: public class ViewForm : Form { SFML.Graphics.RenderWindow _renderWindow = null; public ViewForm() { …
KwentRell
  • 416
  • 1
  • 4
  • 17
0
votes
1 answer

C# - My Collision code won't result in the player stopping in his tracks

I have been working on a C# & SFML remake of one of my LWJGL engines. So far it's going great, but, when I tried to copy/convert over my collision code, things didn't go so well. Here's my code for the player/entity class, bounding box, and the game…
VocableAce
  • 41
  • 5
0
votes
1 answer

cannot move and rotate two CirclarShape objects together in SFML

I have defined a CircularShape named car having 3 points(displayed as triangle) and Circular shape field which is circular in shape, I want field to stay at tip of the car and move along with the tip of the car but the problem is when i run the…
0
votes
1 answer

Handling LuaScriptException in NLua

So I've been working on a simple game engine using SFML.Net for the graphics and what not, and NLua for scripting of games. So I have this method in my BaseGame -class that is supposed to run a Lua script and add some objects and methods etc. to the…
Ricochet
  • 11
  • 3
0
votes
3 answers

C# and SFML game intersection

I have problem with my MoveEntity() method in a 2D platformer game (like PacMan). When player is on intersection path I want to make: e.IsAtIntersection = true; and then call UpdateDirection(). But he doesn't stop, instead he goes through paths and…
0
votes
1 answer

Can't compile project after adding SFML.NET by Nuget

After adding SFML.NET through Nuget Packge manager I got the following error: Error 4 The "UnzipNuspec" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.)…
Anton
  • 1,409
  • 1
  • 19
  • 37
0
votes
1 answer

NLayer MpegFile to SFML.Net SoundStream

I'm currently working on SFML.Net to expand with mp3 support. Therefore I wrote a Stream class which uses NLayer MpegFile to decode the mp3. public class Mp3StreamSFML : SoundStream { private MpegFile mp3file; private int currentBufferSize; …
Sven
  • 447
  • 1
  • 6
  • 22
0
votes
1 answer

NLayer MpegFile to SFML (.NET) Music

I'm currently searching for some way to extended SFML.Net to use MP3. Therefore ioctllr recommended NLayer, which I wanted to try. This is my approach: namespace AudioCuesheetEditor.AudioBackend { public class SFMLMp3Stream : Stream { private…
Sven
  • 447
  • 1
  • 6
  • 22
0
votes
1 answer

Cannot compare two SFML Colors

I have to compare two colors in SFML.net. In C++ it's possible because there is defined == operator. In SFML.net Visual Studio won't let me compile the code. How to resolve that? Error: 1>E:\DB\Dropbox\Repozytoria\ARDSQL…
Over Killer
  • 507
  • 9
  • 24
-1
votes
1 answer

Use key release on SFML library c#

Im trying to write a code using SFML library, when I press a key I change a bool variable. The problem is that I use key presses and I don't know how to implement key release who only works 1 time x key and that's what I'm trying to implement cause…
Nocte
  • 1
-1
votes
1 answer

Failed to load font

Failed to load font "textures/myfont.tff" (failed to create the font face) Font font = new Font("textures/myfont.tff"); menu[0].Style = Text.Styles.Bold; menu[0].Color = Color.Red; menu[0] = new Text("Play", font); menu[0].Position = new…
-4
votes
1 answer

Did I declare this array properly?

I was trying to translate something from C++ to C#, now the translation is completely done, however I'm getting an error when compiling that says index of array is out of bounds so I want to know if I declared the array properly. [Entire Code] using…
1
2