Hi all,
Does Purebasic have an equivalent to the 'viewport' command in Blitz Basic? This command allows you to specify the location and dimensions (in pixels) of a rectangular area on the screen. After it is called, all rendering occurs inside this area without affecting the rest of the screen. This has many uses in games, such as for making a radar display, or a "split screen" mode for a two-player game.
If PB does not have an equivalent command, how would one go about achieving this functionality?
Thanks in advance for any help you can offer!
Viewport?
Re: Viewport?
use CreateCamera() to define a viewport
Please correct my english
http://purebasic.developpez.com/
http://purebasic.developpez.com/
Re: Viewport?
Thank you for your reply. I apologize for not clarifying this before: What I am talking about is for 2d graphics. If I understand it correctly, CreateCamera() works with 3d only?Comtois wrote:use CreateCamera() to define a viewport
Re: Viewport?
Yes.Dither wrote:If I understand it correctly, CreateCamera() works with 3d only?
May be this can help ?What I am talking about is for 2d graphics.
http://www.purebasic.fr/english/viewtop ... 23&start=2
Please correct my english
http://purebasic.developpez.com/
http://purebasic.developpez.com/
Re: Viewport?
Comtois,
Thank you for the link! I will study your code example.
Best regards.
Thank you for the link! I will study your code example.
Best regards.
Re: Viewport?
Thanks, Julian. That is good to know, but ClipOutput does not appear to work with sprites. Also, it gave a very strange and garbled result when I tried it with a loaded image on a screen (Mac version).
I think my workaround is to draw my 'viewport' contents to the backbuffer, then 'grab' them into a new sprite. Then draw the normal screen contents, with the 'viewport' sprite being added last before flipping the buffers.
Thanks again.
Re: Viewport?
Use ClipSprite()Dither wrote:Thanks, Julian. That is good to know, but ClipOutput does not appear to work with sprites.
Please correct my english
http://purebasic.developpez.com/
http://purebasic.developpez.com/