Page 1 of 1

Questions

Posted: Mon Jan 28, 2013 8:42 am
by SolarLune
Hello. I was interested in looking into Pixilang for game development, but I have a few questions.

1) Is it possible to poll for joystick input with Pixilang? I only noticed "button down" and "button up" events. If it's not possible, I think it would be a good idea to add that in.

2) What does 'boot.txt' have to say to be used with the Pixilang executable? Does it have to be a complete program? I assume this is the case, but I'm just asking to be clear. It would seem like you could work around it by having the boot.txt program include and run a function from another pixi file, but it could be a good idea to just have a configuration setting that automatically runs a 'main.pixi' file.

EDIT: I figured out that boot.txt does have to be a complete pixi program.

3) I'm pretty sure I know this, but there's no simple method to automatically load and play sound files (OGG, MP3, SunVox, etc.) apart from DLLs, right? If not, that would be really high on the feature request list for me.

4) Again, I'm pretty sure I know this, but is there no method to stretch the screen (i.e. enable full-screen, or otherwise change the rendering resolution)? If not, I would like to request that feature as well.

EDIT: 5) Where are the keycodes for the letter and number keys? Is the documentation incomplete for the keycodes in particular?

6) I tested out a simple code where:

Code: Select all



a = 0

while (1) 
{

	a + 1

	clear()
	
	print (num2str(a))
	
	printf(num2str(a))
	
	frame(33)

}


And I never get the number of a. Instead I get strings (I assume the strings that the unique container IDs will get me). So, how do you print out simple number values?

- Okay, I figured it out. I had to use printf("%i", num2str(a)). I think it would be wise to focus on improving the documentation, as I don't think that was mentioned anywhere in isolation (i.e. not with another example).

Re: Questions

Posted: Mon Jan 28, 2013 11:15 pm
by NightRadio
1) Is it possible to poll for joystick input with Pixilang?
Sure. Please check this example: graphics/keyboard.pixi
2) What does 'boot.txt' have to say to be used with the Pixilang executable?
boot.pixi is just the first file which will be loaded by Pixilang. Of course you can put the entire program to this file. But also you can distribute your program in different files, and then write something like this in boot.pixi:
include "font_loader.pixi"
include "map_loader.pixi"
include "main.pixi"
3) I'm pretty sure I know this, but there's no simple method to automatically load and play sound files (OGG, MP3, SunVox, etc.) apart from DLLs, right?
Yes. I have the plans for OGG Vorbis support in future updates.
For now you can use SunVox DLL or PixiTracker Player (examples/sound/pixitracker_player.pixi).
4) Again, I'm pretty sure I know this, but is there no method to stretch the screen (i.e. enable full-screen, or otherwise change the rendering resolution)?
Unfortunately there is no fullscreen support in the current version. Only maximized window. Examples:
graphics/screen_resize.pixi (for pure pixel graphics)
graphics_opengl/... (for OpenGL accelerated graphics)
5) Where are the keycodes for the letter and number keys?
For letters:
if EVT[ EVT_KEY ] == 'b' { printf( "B pressed\n" ) }
if EVT[ EVT_KEY ] == 'a' { printf( "A pressed\n" ) }
For numbers:
if EVT[ EVT_KEY ] == '3' { printf( "3 pressed\n" ) }
6) I tested out a simple code where. And I never get the number of a.
Please check the manual: http://code.google.com/p/pixilang/wiki/ ... num_to_str
num2str has two parameters.
So you should write this:

Code: Select all

while (1) 
{
   a + 1
   clear()
   temp_string = ""
   num2str( temp_string, a ) 
   print( temp_string )
   printf( "%s\n", temp_string )
   frame(33)
}
But the best variant is:

Code: Select all

while (1) 
{
   a + 1
   clear()
   temp_string = ""
   sprintf( temp_string, "%d\n", a )
   print( temp_string )
   printf( temp_string )
   frame(33)
}
I think it would be wise to focus on improving the documentation
Agree with you. I'm trying to make it better, but still not enough free time for this.

Re: Questions

Posted: Tue Jan 29, 2013 9:33 am
by SolarLune
I might have been a bit harsh, Night. I know that you're doing this free of charge, and balancing working on this and your other projects, so thanks a lot.

About the joystick polling, I see that you can test for keyboard from the example, but it doesn't do anything for joystick / game pad polling. Is it not possible at the moment?

Re: Questions

Posted: Tue Jan 29, 2013 10:35 am
by NightRadio
About the joystick polling, I see that you can test for keyboard from the example, but it doesn't do anything for joystick / game pad polling. Is it not possible at the moment?
Ah sorry. Do you mean real external joystick? If so, there is no special API and key codes for joystick :( I don't know how to work with it at all. If you have some information about gamepad programming for your OS - give me the link, and i will add this code to Pixilang.

Re: Questions

Posted: Tue Jan 29, 2013 10:51 am
by SolarLune
NightRadio wrote:
About the joystick polling, I see that you can test for keyboard from the example, but it doesn't do anything for joystick / game pad polling. Is it not possible at the moment?
Ah sorry. Do you mean real external joystick? If so, there is no special API and key codes for joystick :( I don't know how to work with it at all. If you have some information about gamepad programming for your OS - give me the link, and i will add this code to Pixilang.
Thanks a lot for the offer. I was hoping for joystick handling to be as cross-platform as Pixilang is (i.e. Win, Mac, Linux, and Android), so a cross-platform solution would be good, I think. What do you write Pixilang in (C++, for example)? SDL has methods to handle joysticks, for example, though I don't think it runs on Android (not out of the box, at least).

Re: Questions

Posted: Wed Jan 30, 2013 9:00 am
by NightRadio
It was C++ and SDL initially. But now SDL is replaced by pure OpenGL.
I will check the SDL sources...

Re: Questions

Posted: Wed Jan 30, 2013 9:23 am
by SolarLune
Oh, okay. Here's something for checking joystick input via SDL (just something from a general Google search).