Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Pasanova

Member Since 16 Sep 2012
Offline Last Active Sep 27 2012 10:26 AM

Posts I've Made

In Topic: Moving a constant number of pixels per second

24 September 2012 - 12:06 PM

Thanks Posted Image Yes, its 2D I am using SDL. okay looks like
that is the way to go!

EDIT: Works a treat!

In Topic: Moving a constant number of pixels per second

24 September 2012 - 12:00 PM

But surely you have to either move a pixel or not? You can't move
0.02 pixels?

In Topic: Quick SDL_ttf question

24 September 2012 - 09:01 AM

Thank you very much for your attempt to help!
I have tried both downloading a font (Eight One.ttf)
and getting one from the windows fonts folder (arial)
I have both these font files copied into the Release folder, Debug folder
the folder where the project is and also in the folder C:\fonts
It seems like I am trying every possible thing!?!?
TTF_Font* font = TTF_OpenFont("arial", 50); //Magic number
    if (font == NULL){
	  std::cerr << "Unable to load font" << std::endl;
    }
   font = TTF_OpenFont("Eight One", 50); //Magic number
    if (font == NULL){
	  std::cerr << "Unable to load font" << std::endl;
    }
   font = TTF_OpenFont("Eight One.ttf", 50); //Magic number
    if (font == NULL){
	  std::cerr << "Unable to load font" << std::endl;
    }
	 font = TTF_OpenFont("C:\\fonts\\Eight One.ttf", 12); //Magic number
    if (font == NULL){
	   std::cerr << "Unable to load font" << std::endl;
    }
    font = TTF_OpenFont("arial.ttf", 12); //Magic number
    if (font == NULL){
	  std::cerr << "Unable to load font" << std::endl;
    }
	  font = TTF_OpenFont("Eight One.ttf", 12); //Magic number
    if (font == NULL){
	  std::cerr << "Unable to load font" << std::endl;
    }
	 font = TTF_OpenFont("./arial.ttf", 12); //Magic number
    if (font == NULL){
	  std::cerr << "Unable to load font" << std::endl;
    }
	  font = TTF_OpenFont("./Eight One.ttf", 12); //Magic number
    if (font == NULL){
	  std::cerr << "Unable to load font" << std::endl;
    }
   else{
   SDL_Color red; //Move this definition
   red.r = 255;
   red.g = 0;
   red.b = 0;
   textSurface_ = TTF_RenderUTF8_Blended(font,text.c_str(),red);
   }
Each of these returns NULL. I am sure it is just something silly but
I have initialised SDL_TTF (after I have created the screen)
I am just stuck for ideas??
Its so frustrating when you just cannot move your project
forward even though you know what the problem is!

In Topic: Constant acceleration: Point out why I am an idiot

16 September 2012 - 08:52 AM

Thanks Bacterius!
I have just reread that section and you are exactly right! Thank you so much!
It makes a lot more sense to me now :) It is a very good book in general
even if the variable names are very misleading here!

PARTNERS