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.


Messages - jerryd

Pages: 1 2 3 [4]
46
Graphics / Re: SubRect Problem
« on: May 05, 2013, 03:42:24 am »
SFML forum,

 I solved this problem.

Jerryd

47
Graphics / SubRect Problem
« on: May 05, 2013, 03:18:20 am »
SFML forum,
 SFML 1.6  Visual C++ 2010

 I have an png that is 64 x 320 and contains 5 sprite pictures.
 1 2 3 4    the last one is blank.

 If I use:
 Numbers.SetSubRect(sf::IntRect(0,0,63,63));
 Screen.Draw(Numbers);
 a 1 is dispayed.

 If I use:
 Numbers.SetSubRect(sf::IntRect(64,64,127,127));
 Screen.Draw(Numbers);
 nothing is dispayed.

 If I use:
 Numbers.SetSubRect(sf::IntRect(0,0,127,127));
 Screen.Draw(Numbers);
 1 2 is dispayed.

 etc.......

 I have successfully used the same png file in another IDE
 where all I have to do is set the frame number.

 I have attached the .png file.

 Any suggestions?

jerryd


[attachment deleted by admin]

48
Graphics / Re: setOrigin fails
« on: May 03, 2013, 05:40:22 am »
Jebbs,

 That worked.

 I had read about and tried setCenter() but it
 also failed.  Probably because of the wrong case.

 Using Visual C++ 2010 I set all the properties to the SFML20
 include and lib files but when I leave the properties menu
 it doesn't load them?  I know the paths are correct because
 I use the "edit" function to set the paths.

 The only thing that works is Render Window.  Every other sf
 type command, such as "SetFramerateLimit()" or "LoadFromFile",
 is colored red in the editor.  All works with SFML-1.6

jerryd

49
Graphics / Re: setOrigin fails
« on: May 03, 2013, 05:04:51 am »
Jebbs,
 Thanks for the reply.

 Tried SetOrigin but got the same error message.

 I have downloaded and compiled SFML20 but can't seem to get
 the include files to work yet.

Any more suggestions about the SetOrigin?

jerryd

50
Graphics / setOrigin fails
« on: May 03, 2013, 04:30:30 am »
SFML forum,

 SFML 1.6,  Visual C++ 2010

 I load an image and set it as a sprite:

   MyImage.LoadFromFile("Sprite2.bmp"))

   // Create a sprite called Rocket from MyImage
   sf::Sprite Rocket(MyImage);

 This all works and the sprite appears on the screen.

 Now when I try to set the origin of the sprite:
   Rocket.setOrigin(25, 25);

 I get a compiler error saying:
 error C2039: 'setOrigin' : is not a member of 'sf::Sprite'

 What am I doing wrong here?

jerryd

51
Graphics / Sprite.setOffest causes compiler error
« on: April 23, 2013, 05:13:42 am »
SFML forum,

 SFML 1.6,  Visual C++ Express 2010

 I've searched this forum for posts on this subject but
 none of them answer my question.

 I want to relocate the x/y origin of a sprite for rotation.

 I've seen example programs that uses code like:
 Sprite.setOrigin(100, 100);

 But if I try to use this I get a compiler error that says:
 error C2039: 'setOrigin' : is not a member of 'sf::Sprite'

 This command exists in the sf::Sprite Class Reference so
 I'm confused and stuck?

jerryd

52
Graphics / Re: LoadFromFile always fails
« on: April 22, 2013, 07:24:46 am »
SMFL forum,

 Found the problem.  I didn't have sfml-graphics-d.lib in the
 Linker INPUTS.

 I have downloaded and compiled SFML 2.0.
 I made a solution similar to this one but when I click on the
 "build" the compiler option is grayed out.  If I type F5 I get
 an error message that says:
 "LINK : fatal error LNK1561: entry point must be defined"

 What am I missing?

jerryd

53
Graphics / Re: LoadFromFile always fails
« on: April 21, 2013, 05:28:38 am »
Laurent,
 I realized that I could get all the instructions I
 needed on the net.

 I went through the entire tutorial on compiling SFML at:
 
 and got the sample program to work.

 I changed all the properties in my FirstWindow solution but
 got the same error message.


Here's my code:

#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>

int main()
{
   // Render up a window called MyWindow
   sf::RenderWindow MyWindow(sf::VideoMode(800, 600, 16), "SFML Window");

   MyWindow.SetFramerateLimit(60); // Limit to 60 frames per second

   // load the image
   sf::Image MyImage;
   //MyImage.LoadFromFile("Sprite2.bmp");

   bool Running = true;
   while (Running)
   {
      // check if there are any events
      sf::Event MyEvent;
      while (MyWindow.GetEvent(MyEvent))
      {
         // Window closed by X
         if (MyEvent.Type == sf::Event::Closed) MyWindow.Close();

         // Escape key pressed
         if ((MyEvent.Type == sf::Event::KeyPressed) && (MyEvent.Key.Code == sf::Key::Escape))
            MyWindow.Close();
      }

      // Clear the screen to black
         MyWindow.Clear(sf::Color(0, 0, 0));

      // display the window pointed to by MyWindow
      MyWindow.Display();
   }
   return EXIT_SUCCESS;
}

 See anything wrong here?

jerryd

54
Graphics / Re: LoadFromFile always fails
« on: April 21, 2013, 02:20:59 am »
Laurent,
 Thanks for the reply.

 I'm following a tutorial at:
 http://www.sfml-dev.org/tutorials/1.6/graphics-sprite.php

 These totorials are for SFML 1.6 and Visual C++ 2010 Express
 so I never loaded Visual Studio 2008.  Also I don't know how
 to compile SFML.

 Can you give me some instructions?

jerryd


55
Graphics / LoadFromFile always fails
« on: April 20, 2013, 07:28:37 am »
SFML forum,

 SFML 1.6  Visual C++ Express 2010

 I'm new to SFML and have a very simple "open a window" program
 called FirstWindow that works.

 Now I try to load an image with this code:
   sf::Image MyImage;
   MyImage.LoadFromFile("Sprite2.bmp");

 It compiles without errors but when I run it I get this message:
 "FirstWindow has encountered an error and must close".

 If I comment out the LoadFromFile command the program runs OK.

 The file Sprite2.bmp resides in the program folder and I
 can open it and see the bmp image.

 Any suggestions?

jerryd

Pages: 1 2 3 [4]
anything