Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Mario1159

Pages: [1]
1
DotNet / Error loading images/textures
« on: September 22, 2018, 04:01:08 am »
My program let the user select an image (examine) and load it.
Most of the images load and display fine but some of them throw an exception
(SFML.LoadingFailedException: 'Failed to load texture from file C:\Users\ ... \t_bg.jpg')
  in the following line:
Image img = new Image(path);
or
Texture texture = new Texture(path);
At first i thought it could be the path that is wrong so i tested opening a file that throw the exception in the search bar of a windows folder and it opened successfully.
To confirm that the path is not wrong i tried creating an image but with System.Drawing and it didn't gave me an exception.

Next i thought maybe it has to do with the security so i placed this in my code:
        [FileIOPermissionAttribute(SecurityAction.PermitOnly,
     ViewAndModify = @"C:\Users\ ... \(folder that cointains t_bg.jpg file)\")]
But it didnt work either.

What could be the problem?

2
DotNet / Inheritance question [SOLVED]
« on: July 14, 2018, 10:50:11 pm »

I want to access to the rectangle/convex/circle methods in my sGameObject, dGameObjects or Player class but i dont know how, because my current class sGameObject just have a Shape {get;set;} so i can create for example a sGameObject doing this:
RectangleShape rectangleShape = new RectangleShape(new Vector2f(50f,50f));
SGameObject box = new SGameObject();
box.Shape = rectangleShape;

//but i cant access to the RectangleShape methods
box.RectangleShape.getSize(); // error
 

Pages: [1]