Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scee.yaroze.beginners Subject: Re: Backgrounds Date: Wed, 21 May 1997 12:14:41 +0100 Organization: Sony Computer Entertainment Europe Lines: 50 Message-ID: <3382D921.3000@interactive.sony.com> References: <3380C107.1DAC@netcomuk.co.uk> Reply-To: N/A-Use-Newsgroup NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) Ira Rainey wrote: > > Maybe it's just me back I can't work out how to display an image as a > background as a whole - a 320x240 image, as a startup screen. > > Do I use the GsSprite functions or GsCell & GsBG? > > Any chance of anyone posting some simple code - with good comments > please. > > Ira. > -- > "Never take life too seriously, 'cause you know you're not getting out > of it alive." - Bugs Bunny There are several ways to display a background. Firstly: sprites, either one large one or several small ones. Note that no sprite/polygon can ever have a texture area bigger than 256 by 256, hence if your screen res is in any way higher than that, you will need to scale a single sprite to make it fill the screen. Drawing sprites is very straightforward and clean. The 2d and 2d2 sample code directories show how to do various things with sprites. Secondly: you can use a polygon with a texture, but this ends up being similar to using a sprite; the polygon must be orientated to be straight-on to the camera, and can be 'scaled' by altering its distance from the viewpoint. Thirdly: you can use MoveImage to directly copy one area of VRAM to another, eg copy from one large TIM texture onto both dispay/draw buffers (or one large area if using interlace rather than double buffering). MoveImage is quite quick, and for a startup screen, can just be done the first frame rather than redoing every time. MoveImage is very straightforward but there is no possibility of scaling the image or adjusting its bit-depth, tinkering with rgb or palette colours, etc. To fill the whole screen requires a pretty large TIM. Fourthly: you cn use the GsBG/GsCELL/GsMap collection of items designed for doing scrolling sprite-ish backgrounds; the SCEI sample code includes a demo of using this, which is nicely done. Lewis