|
Post by u9 on Jun 3, 2007 4:53:08 GMT -5
When i run this code:
Option explicit graphics.initialize key.initialize
Dim font font = graphics.createfont( "Courier New", 12 )
Dim file, image file = gui.ShowOpen() image = graphics.loadimage( file ) Do graphics.clear graphics.setimage image graphics.display Loop until key.pressed( vk_escape ) Or key.pressed( vk_windowx )
key.terminate graphics.terminate
I get this error:
Graphics initialized Key initialized Font Courier New created Error -2005529767 in graphics loadimage, file: C:\Documents and Settings\u9\My Documents\programming\brutus2d\C:\Documents and Settings\u9\My Documents\programming\brutus2d\Asteroids_of_Fire_v0.9\gfx\asses_of_fire.png Key terminated Graphics terminated
After selecting a file. This is the same problem i have when creating exe's. It writes out part of the path twice. Any ideas how i can select a file with the showopen dialog? and does it accept any inputs? the documentation on it is quite scarse.
|
|
|
Post by Guilect on Jun 3, 2007 9:59:16 GMT -5
There is a bug. Thanks for finding it. Actually the GUI.ShowOpen works fine. The bug is in Graphics.LoadImage. B2D uses the code path as the default path to images. So in this case LoadImage is prefixing the filename with the path to the source code. It has been fixed. B2D will use the code path for images only when no other path has been selected, like by the ShowOpen command. It is in V1.8 As for documentation of the command , nothing is missing. you call the command GUI.ShowOpen() and it returns the file path and name. But I know You ;D so... For parameters, in V1.8, you can optionally specify the Title of the dialog window, and optionally specify the file filter setting. (and yes, it will be the same for ShowSave )
|
|
|
Post by u9 on Jun 3, 2007 14:57:33 GMT -5
Hehehe Well yeah i was looking if i could set title, file extension and also the default path it opens in.. but it is not that important..
|
|