4
I Use This!
Very Low Activity

News

Analyzed about 14 hours ago. based on code collected about 14 hours ago.
Posted about 15 years ago by Olivier Boudeville
Sorry, I was wanting to send it to the list as well. Olivier. -------- Message original -------- Sujet: Re: [Agar] Centering elements Date : Thu, 25 Nov 2010 23:34:04 +0100 De : Olivier Boudeville <olivier.boudeville-JzmmFc79I1NQFI55V6+gNQ< ... [More] at >public.gmane.org> Pour : Julien Nadeau <vedge-xWq8P/a1moLx9BLsLxWUfA< at >public.gmane.org> Hi Julien, Thanks for your answer, it works good for labels. Is there a way to do the same for images as well? Centering and right-aligning would be quite convenient. On an unrelated note, is there any other way than using AG_SetDefaultFont to set the font to be used for a label? Should not there be a font associated to a label? Regarding HTML links: - http://libagar.org/mdoc.cgi?man=AG_Font.3 is a dead link (ex: referenced in http://libagar.org/mdoc.cgi?man=AG_FontSelector.3) - same thing for http://libagar.org/mdoc.cgi?man=printf.3 (from http://libagar.org/mdoc.cgi?man=AG_Label.3) - a link to 'font' from 'label' could be interesting Thanks again for this library, Best regards, Olivier Boudeville. Le 24/11/2010 05:05, Julien Nadeau a écrit : _______________________________________________ Agar mailing list Agar-xWq8P/a1moLx9BLsLxWUfA< at >public.gmane.org http://libagar.org/lists.html [Less]
Posted about 15 years ago by Julien Nadeau
This should do the trick: AG_Label *label; label = AG_LabelNew(parent, AG_LABEL_HFILL, "foo"); AG_LabelJustify(label, AG_TEXT_CENTER); Fixed, thanks. "fixedres" is the correct one.
Posted about 15 years ago by Olivier Boudeville
Hi, I would like to display a label centered in its container: is there any built-in way to do that? I was also thinking to computing and assigning directly its coordinates to have it at the center (thus bypassing the actual packing system), or ... [More] to use empty left/right and top/bottom elements so that a pane would pack it by design at the center, but both solutions seem a bit awkward? By the way in http://libagar.org/mdoc.cgi?man=AG_Fixed.3a demos/gamemenu demo is mentioned but does not seem to exist (at least not on the 1.4.0 version from SVN). Thanks, Best regards, Olivier Boudeville. _______________________________________________ Agar mailing list Agar-xWq8P/a1moLx9BLsLxWUfA< at >public.gmane.org http://libagar.org/lists.html [Less]
Posted about 15 years ago by Olivier Boudeville
Hi, When defining a label, using the default font results in a properly shaped surface: http://esperide.com/label-with-default-font.png whereas using another (non-default, TTF) font leads to a truncated surface, apparently not taking into account ... [More] the actual size of the text: http://esperide.com/label-with-ttf.png Unless there is something specific to be done so that labels are resized accordingly? (corresponding minimal test code is attached) Minor typo: in the doc of AG_FetchFont (http://libagar.org/mdoc.cgi?man=AG_Text.3#AG_TextInfo), the signature mentions "points", whereas the text uses "size". By the way, any answer regarding my preceding mail about going to fullscreen mode? Thanks for any hint, Olivier Boudeville. _______________________________________________ Agar mailing list Agar-xWq8P/a1moLx9BLsLxWUfA< at >public.gmane.org http://libagar.org/lists.html [Less]
Posted about 15 years ago by Vern Jensen
Great to hear, thanks for the reply Julien. Question: how would I make Agar on OS X so it: A) Uses the MacOS X 10.4 API (i.e. minimum requirement is 10.4) B) Is Universal Binary C) Uses OpenGL (as well as SDL, but OpenGL is my renderer) D) Uses ... [More] Freetype (already installed and built) I'm running on OS X 10.6, but when using XCode projects, you simply specify the MacOS X API you want to build against (in my case 10.4). I don't know how to specify this when using the UNIX style build process instead of XCode. (And also, the pre-compiled binary that ships for OS X is PPC-only. I need a Universal Binary version.) Another option might be to just drop Agar's source directly into my project? If so, how would I configure that it should use OpenGL, and which source files would I want to add? Hope my questions aren't too noobish... -Vern [Less]
Posted about 15 years ago by Julien Nadeau
Agar 1.4 should work on any version of OS X. It happens that I had 10.5 installed on my laptop at the time that release was made. We don't have the resources to provide precompiled binaries for every OS X version, but you shouldn't have any problem ... [More] compiling Agar 1.4 from source on OS X 10.4. If you run into compilation problems, please don't hesitate to file a bug report. On Tue, Nov 16, 2010 at 09:00:24PM +0000, Vern Jensen wrote: [Less]
Posted about 15 years ago by Vern Jensen
I'm developing a cross-platform game based on SDL 1.3 and OpenGL. I'd like to add dialog boxes, and Agar looks perfect for this. However, I'd like my game to be able to run on MacOS X 10.4 and later. It seems Agar 1.4 requires OS X 10.5 Looking ... [More] at the SVN tree, it appears that Agar 1.3.3 has a build for MacOS X 10.4. I'm wondering what the advantages / disadvantages to using this older build would be. My needs are pretty modest. I mostly want simple message dialog boxes, but in some cases a field for text input (so a user can enter their high score), plus a more complicated Options dialog box, with sliders for music/volume, pop-up menus for graphics settings, and checkboxes for other options. Any reason to not go with Agar 1.3.3, so I can compile for OS X 10.4? [Less]
Posted about 15 years ago by Julien Nadeau
Hi, This is caused by a bug in Agar-1.4.0, which incorrectly selected the "sdlfb" driver in this case. The fix is in SVN and will be included in the next release. On Wed, Nov 10, 2010 at 03:24:17PM +1100, Darcu wrote:
Posted about 15 years ago by Darcu
Hi, I've been working to build a SDL+OpenGL game engine for a while now, and decided to build the editor GUI using Agar. Anyway, I want to be able initialize the OpenGL/SDL context myself, and then to be able to turn on an editor mode in the engine ... [More] using Agar later. Anyway, I wrote some small test code to see if I could launch Agar with a previously defined OpenGL SDL_Surface. The program is adapted from the C++ demo. Code: #include <agar/core.h> #include <agar/gui.h> #include <agar/gui/opengl.h> #ifdef _APPLE_ #include <SDL/SDL_opengl.h> #include <SDL/SDL.h> #else #include <SDL_opengl.h> #include <SDL.h> #endif #include <iostream> using namespace std; int main(int argc, char *argv[]) { AG_Window *win; SDL_Surface * screen; SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER); /*Set buffer sizes*/ SDL_GL_SetAttribute(SDL_GL_RED_SIZE,8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,8); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE,8); screen = SDL_SetVideoMode(640,480,32,SDL_OPENGL| SDL_HWSURFACE); if (AG_InitCore("cpp-demo", 0) == -1) { cerr << AG_GetError() << endl; return (1); } if (AG_InitVideoSDL(screen,AG_VIDEO_OPENGL) == -1) { cerr << AG_GetError() << endl; return (-1); } AG_BindGlobalKey(AG_KEY_ESCAPE, AG_KEYMOD_ANY, AG_Quit); win = AG_WindowNew(0); AG_LabelNew(win, 0, "Hello World!"); AG_WindowShow(win); AG_EventLoop(); AG_Destroy(); return (0); } As you can see I'm calling AG_InitVideoSDL. The above code segment works correctly if you remove the SDL_OPENGL flag from SDL_SetVideoMode, otherwise it causes a segmentation fault when AG_EventLoop is called. I did a stack trace, and found that the function SDL_FillRect was being called, which would indicate that the non-opengl sdl driver is being called. So, my question is this, what is the correct way of setting Agar up for an OpenGl based SDL_Surface which has already been created. I'm keen to have a strict control on Agar using a custom event loop, but for now I just want to get it accepting my surface. [Less]
Posted about 15 years ago by Fabian Svara
Hi, when a menu generated by AG_MenuNew contains a submenu, e.g. created like this: menu = AG_MenuNewGlobal(0); AG_MenuNode(menu->root, "Item 1", NULL); menuItem = AG_MenuNode(menu->root, "Item 2", NULL); { ... [More] subMenuItem = AG_MenuNode(menuItem, "Subitem", NULL); AG_MenuAction(subMenuItem, "Subitem Action", NULL, cb, NULL); } Then it is possible to open the submenu window containing the "Subitem Action" entry with the window containing the "Subitem" entry being collapsed. This is achieved by opening the "Item 2" menu and then quickly moving the mouse from the "Subitem" to "Item 1". This is dependent on timing but can easily be triggered. This in itself isn't very beautiful, but when the "Subitem" is then expanded a second time, the application crashes. I also reported this to bugzilla, #174. The following change to gui/menu.c fixes the problem for me, but I didn't spend the time to check whether this was the "right" way to solve the issue... --- menu.c 2010-04-15 15:18:09.000000000 +0200 +++ menu.c 2010-10-29 14:23:24.442771835 +0200 < at >< at > -167,6 +167,8 < at >< at > x += WIDGET(parentWidget)->rView.x1; y += WIDGET(parentWidget)->rView.y1; winParent = WIDGET(parentWidget)->window; + if(!winParent) + return(NULL); } else { m = mi->pmenu; winParent = NULL; Best regards, Fabian Svara [Less]