Fwd: [SDLx-Widget] SYNOPSIS-code doesn't work: missing font (#2)

2012-01-10 Thread Kartik Thakore
Woops

Begin forwarded message:

*From:* Alex 
reply+i-2784720-7298c9ca04eb299d5d048ccbac880cc879c5ad67-21...@reply.github.com

*Date:* 10 January, 2012 7:58:06 AM EST
*To:* Kartik Thakore thakore.kar...@gmail.com
*Subject:* *[SDLx-Widget] SYNOPSIS-code doesn't work: missing font (#2)*

Hi!

The code in SYNOPSIS does not work as it is, it dies with an error:
Attribute (font) is required at menu.pl line 14

Here is some demo code:

perl```
   #!perl

   use strict;
   use warnings;
   use SDL;
   use SDLx::App;
   use SDLx::Widget::Menu;

   my $app = SDLx::App-new(
   title = 'Menu demo',
   exit_on_quit = 1,
   );

   my $menu = SDLx::Widget::Menu-new-items(
   'New Game' = \play,
   'Options'  = \settings,
   'Quit' = \quit,
   );

   $app-run();

   exit(0);

Maybe you can add default font support as it is done in SDLx::Font?


hth,
Alex

---
Reply to this email directly or view it on GitHub:
https://github.com/PerlGameDev/SDLx-Widget/issues/2


Re: Revamping SDL_Manual

2012-01-10 Thread Kartik Thakore
On 2012-01-10, at 2:03 AM, Alexander Becker cap...@gmx.de wrote:

 Hi Kartik,

 I recently started working with the SDL Manual, but I don't have a game in 
 mind. Regardless of that, I find it very useful to see the things you can do 
 with SDL demonstrated with games. What I'm missing so far, and what is part 
 of every game, too, is UI stuff. How do buttons work with SDL, how do you 
 change the state of a button element (normal, active, hover, diabled,  etc.) 
 and how do you encapsulate such UI elements properly.


Perhaps getting Agar working again in perl will help? Http://libagar.org/

 Basically, I'm still experimenting to find a way to create a good button 
 class for a menu. I know there is a package out there that provides methods 
 for drawing menus, but especially when writing your own games / apps, I guess 
 one might want to implement its own kind of menu with nifty nice effects, 
 layout and so on.


Hmm we would love it if you can provide feedback/issues on the
SDLx::Widgets github site.

 So this is my idea: add a chapter on UI elements (not only buttons, but 
 (high-score-tables, text fields etc.). Unfortunately, all I can add to this 
 project so far (I'm still a SDL n00b) are possibly dumb questions. For 
 example, I don't know how to adjust a text on a surface for a button. By 
 adjusting, I mean something like aligning to the left or the right or 
 automatically splitting the text up an breaking into a new line when a given 
 with would be exceeded (I'm generating buttons with unknown text length, 
 which is quite problematic).

Seems like a good idea. Thanks.
 hth,
 Alex

Kartik
  Original-Nachricht 
 Datum: Mon, 9 Jan 2012 16:34:25 -0500
 Von: Kartik Thakore thakore.kar...@gmail.com
 An: sdl-devel@perl.org, chromatic chroma...@wgz.org
 Betreff: Revamping SDL_Manual

 Hello guys,

 So as I have gotten busy over the last couple months with my startup and
 masters the  SDL Manual has fell behind, and I would like to ask if anyone
 is interested in taking on writing new chapters or reorganizing SDL
 Manual.
 We can discuss any new chapters to add and work with reorganize it. An
 idea
 I have is to change the name to Perl Game Development and incorporate more
 then just SDL chapters into the manual. Any suggestions are welcome!

 Regards,
 Kartik

 --
 NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
 Jetzt informieren: http://www.gmx.net/de/go/freephone


AW: Revamping SDL_Manual

2012-01-10 Thread Alex
Hi Kartik,

I had a look at Agar and I didn't find it that useful. One would stick with
just another UI framework, that runs on SDL and has another design
philosophy (GUI around the app, not vice versa). 
In the end, you still face the question, how you would do it yourself. Have
a look at current games. Starcraft has its own kind of menu with a rotating
planet and a hover event, warcraft series has some sort of animated moving
menu (with hover, too) and battlefield 1942 even has a video as background
(which I find quite fascinating, is this possible with SDL, too?). They
don't use the same set of UI items. But they all use the same kind of logic.
There are UI items and events attached to them. How they are forged,
drawn, if they are 3d models or surfaces doesn't matter. That's where the
interesting part begins. How do you create such an interactive item? And how
to use it? And would there be other ways of doing it? Maybe a gentle reader
would explore such a way.

The single thing I really would appreciate out of the Agar package would be
the table, as I imagine this a whole lot of work. I would like to use a
drop-in for that :)

Please note: I hope my word choice doesn't sound that negative, it isn't
intended that way. English is simply not my native language.

Best regards,
Alex

-Ursprüngliche Nachricht-
Von: Kartik Thakore [mailto:thakore.kar...@gmail.com] 
Gesendet: Dienstag, 10. Januar 2012 15:13
An: Alexander Becker
Cc: chroma...@wgz.org; sdl-devel@perl.org
Betreff: Re: Revamping SDL_Manual

On 2012-01-10, at 2:03 AM, Alexander Becker cap...@gmx.de wrote:

 Hi Kartik,

 I recently started working with the SDL Manual, but I don't have a game in
mind. Regardless of that, I find it very useful to see the things you can do
with SDL demonstrated with games. What I'm missing so far, and what is part
of every game, too, is UI stuff. How do buttons work with SDL, how do you
change the state of a button element (normal, active, hover, diabled,  etc.)
and how do you encapsulate such UI elements properly.


Perhaps getting Agar working again in perl will help? Http://libagar.org/

 Basically, I'm still experimenting to find a way to create a good button
class for a menu. I know there is a package out there that provides methods
for drawing menus, but especially when writing your own games / apps, I
guess one might want to implement its own kind of menu with nifty nice
effects, layout and so on.


Hmm we would love it if you can provide feedback/issues on the SDLx::Widgets
github site.

 So this is my idea: add a chapter on UI elements (not only buttons, but
(high-score-tables, text fields etc.). Unfortunately, all I can add to this
project so far (I'm still a SDL n00b) are possibly dumb questions. For
example, I don't know how to adjust a text on a surface for a button. By
adjusting, I mean something like aligning to the left or the right or
automatically splitting the text up an breaking into a new line when a given
with would be exceeded (I'm generating buttons with unknown text length,
which is quite problematic).

Seems like a good idea. Thanks.
 hth,
 Alex

Kartik
  Original-Nachricht 
 Datum: Mon, 9 Jan 2012 16:34:25 -0500
 Von: Kartik Thakore thakore.kar...@gmail.com
 An: sdl-devel@perl.org, chromatic chroma...@wgz.org
 Betreff: Revamping SDL_Manual

 Hello guys,

 So as I have gotten busy over the last couple months with my startup 
 and masters the  SDL Manual has fell behind, and I would like to ask 
 if anyone is interested in taking on writing new chapters or 
 reorganizing SDL Manual.
 We can discuss any new chapters to add and work with reorganize it. 
 An idea I have is to change the name to Perl Game Development and 
 incorporate more then just SDL chapters into the manual. Any 
 suggestions are welcome!

 Regards,
 Kartik

 --
 NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
 Jetzt informieren: http://www.gmx.net/de/go/freephone
-
eMail ist virenfrei.
Von AVG überprüft - www.avg.de
Version: 10.0.1416 / Virendatenbank: 2109/4132 - Ausgabedatum: 09.01.2012