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 - hthornto

Pages: [1]
1
Graphics / Re: Tryng to create two views
« on: February 03, 2017, 04:32:16 am »
Thanks, You formula is great idea. I was able to get it to work.

2
Graphics / Re: Tryng to create two views
« on: February 03, 2017, 02:02:35 am »
I have two views the first covers the second view, blotting out the second view. I need these two  views to be shown at different sections on the screen. Thanks

3
Graphics / Tryng to create two views
« on: February 03, 2017, 01:24:02 am »
I am again struggling. I am trying to create two views. The view is suppose to be menu and the other view the playing surface. Both views are covering the same space. I am currently trying to make views shift to different areas.

Here is my main rendering code;

_render.setView(_render.getDefaultView());
               
               
                _render.setView(_menu.menuView(sf::FloatRect(0, 0, 0.5, 0.5)));
                texture.draw(_menu.newBoard());
                sf::View current = texture.getView();
                _render.setView(_render.getDefaultView());

               
                _play.viewport(sf::FloatRect(0, 0.5, 1, 1));
                _render.setView(_play._view);
                texture.draw(_play.draw());
                sf::View currentview = texture.getView();
               
               
                //Return drawing back to main window
                _render.setView(_render.getDefaultView());
                texture.display();
                _render.clear();


And here is my viewport function:

_view.reset(sf::FloatRect(200, 200, 300, 200));
       
        _view.setCenter(20, 20);
        _view.setSize(800,800);
       
       
        _view.setViewport(dimensions);
       
       
        return _view;

Thanks.

4
Graphics / Re: Drawing New Graphics
« on: January 31, 2017, 05:57:18 am »
Thanks, it made a big difference.

5
Graphics / Re: Drawing New Graphics
« on: January 31, 2017, 04:23:40 am »
It breaks with an error at this point I do not understand right after trying to draw the text.  I am thinking it is the redrawing. Maybe it is the text code. I am including the loading text function that I created.
sf::Text& WinLost::loadText(std::string messange)
 {
   
   
   
   
   
   text.setFont(loadFont("Fonts/chintzy.ttf"));
   
   
   text.setString(messange);
   text.setPosition(80, 90);
   text.setCharacterSize(24);
   
   return text;
}


6
Graphics / Re: Drawing New Graphics
« on: January 31, 2017, 04:08:26 am »
My render function looks like this:
   texture.clear();
   if (win == true)
   {
      texture.draw(_results.loadText("Win"));
   }
   else if (lose == true)
   {
      texture.draw(_results.loadText("Loser"));
   }
   else
   {

      texture.draw(_scissors.scisssorsdraw());
      texture.draw(_rock.rockDraw());
      texture.draw(_paper.paperDraw());
   }
      texture.display();
      
      _render.clear();
      sf::Sprite sprite(texture.getTexture());

      _render.draw(sprite);
      _render.display();


The debugger gives this
+      this   0x006ff1a0 {_render={...} _mouse={...} _events={type=MouseButtonPressed (9) size={width=0 height=305 } ...} ...}   MainGame *
+      sprite   {m_vertices=0x006fdf34 {{position={x=-107374176. y=-107374176. } color={r=204 'Ì' g=204 'Ì' b=204 'Ì' ...} ...}, ...} ...}   sf::Sprite


7
Graphics / Drawing New Graphics
« on: January 31, 2017, 02:22:07 am »
I am creating a simple rock paper scissors game. When the player wins or loses, the screen should clear and the words loser or wins appears on the screen. I am able to draw the rock paper scissors; however, it will not clear the screen and draw the new texts. Instead the debugger breaks the program. I am not sure how to fix this issue.

Pages: [1]
anything