From: Kevron R. <ke...@ne...> - 2007-06-02 18:00:44
|
--- Andreas Brauchli <a.b...@el...> wrote: > hi kev, > > i'm mailing on-list as it might be useful to more > people than me.. and > it gets archived :) > > sa you already know i'm planning on doing some > catchup with all the > changes that happened it the last month were i've > not been very active. > the OSD class is definately something that has to be > in the next release > so that's what i'm after as i originally started it. > If we can get it in lets do it :) . > what class do i need extend to get the OSD display > on the screen? (which > class provides me with an SDL_Rect or Surface to > draw on?) because the > screen already features an OSD part (which is > included in > background.png) so all i need is to render the text > properly in it and > apply some fancy effects to display large > data/OSD-"pages". > You can use surfaceClass to control the position and rendering of the OSD text surfaces. In the OSD class you'll want to create your surface first and then load it with the position into surfaceClass. One line text surfaces can be created with a simple: surfaceClass::init(TTF_RenderTextBlended("TITLE OF SONG",font, color), SDL_Rect, Alpha); for Llrger text surfaces with multiple lines I would create a surface with a set height and width with a transparent fill color: tempsurface=SDL_CreateRGBASurface(height,width,fillcolor,foo); SDL_SetAlpha(temp,FOOBAR,0);//sets all pixels to completely transparent. surfaceClass::init(tempsurface,SDL_Rect, 0); and then render the text to surfaceClass::mysurface; > or would it be better to split the display area from > the background, > that way skins can easily define where this area is. > > if we keep the current implementation they'd need to > place it where they > want the OSD on the background and change to code to > render the OSD-text > where the new position is. > tell me what you prefer (i'm for split) and i'll > contact eubey to split > that up for me if you want that, too. > I wouldn't do the splitting. I would just blit the rendered text from its own surface onto whatever background surface is. The skinner would then just have to specify where the text goes. > andreas kEV |