Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zeroid

Pages: [1] 2
1
Scripting / Re: How to access objects inside surface?
« on: June 11, 2015, 12:43:08 AM »
ok. thanks for the tip.
i figured that i make a global table to store all reference to be used later.
that's the closest i get.

2
Scripting / Re: Arrange Surface in Order?
« on: June 10, 2015, 11:11:56 AM »
thank you

3
Scripting / How to access objects inside surface?
« on: June 10, 2015, 11:10:52 AM »
I have added an image into surface.
I have added an video into surface.
how do it access that video inside surface and set it's video_flag without resign a new variable to it?

Code: [Select]
function ShowVideo()
{
  local myhome = fe.add_surface(width, height);
  myhome.add_image("photo.jpg");
  myhome.add_image("video.avi");
}

now i want to set and access this "video.avi" that i've added.
how can i do this without assigning another variable to it.

I don't want:
Code: [Select]
local myvideo = myhome.add_image("video.avi");
myvideo.visible = false;


I want:
Code: [Select]
myhome["video.avi"].visible = false;
Is this even possible?
The reason i want to do this is because i wanted to call the "video.avi" and set attributes to it or do stuff to it from different functions i've made.
Example the above could be coded inside a function "ShowVideo()" and now i wanted to access it from another function "HideVideo()".
How can I do this?


4
Scripting / Arrange Surface in Order?
« on: June 10, 2015, 09:57:26 AM »
Anyway to arrange "Surface" in Front & Back order?

5
Scripting / Complete parameters for UserConfig class?
« on: June 10, 2015, 08:44:55 AM »
Is there any documentation about the complete UserConfig class parameters and other details?
such as:
Code: [Select]
</ label="Show Message", help="Show Warning Message", options = "Yes,No" /> show_msg = "No";

6
Scripting / How can i copy file from source to target in AM?
« on: June 10, 2015, 01:00:05 AM »
I obviously dont see how I can do this.
I did tried to look at Squirrel to do it.
Apparently my C skills sucks and I only know C#.

Anyone would shine me a light would be very much appreciated.
Thanks in advance.

7
ok. I appreciate the help. but i have to break it to you.
the fe.get_art("snap") does not return anything.

i tried to print() it and nothing came out.
im sure i have the snap folder setup as artwork coz it loads the images i need when i select the games.

not sure where went wrong.


EDIT: I'm an idiot for not having the "fe.list.index" set to any number.
Anyway, it works now.
Thanks.

8
Hmm... how the hell did I missed that~!!!!!???
Shame on me...

9
i tried to get any string from artwork.file_name unfortunately nothing is being returned.
basically null.

that's why i drop that and was hoping there is other workaround.
I would use the "file_exist" method you showed me on the other thread but here comes another problem.

is there anyway i can resolve the "snap" (artwork) path?
the user will enter any path they like to point to any directory, but in the code i wanted to "resolve" that to a physical string path, how would i be able to do that.

the AM document doesnt really show stuff like this.
and when i try to use "artwork.file_name" to get the full path so that i can trim off the end and figure out the actual physical path that was given to "[snap]", it wont work becoz "artwork.file_name" returns null.

10
ok. i managed to solve that and apparently i do need to generate the list once to allow the snap to be viewed.
after the list generated, any image i replaced will just display without problems.

now, i do have another question.
How can I detect if the image loaded from snap is not available and i wish to change that fe.image into something else programmatically?

imagine, when i load the snap folder, and 3 out of 10 games were loaded but the 7 blanks remains because i dont have any image in the snap folder.
and i wanted to replace it with a placeholder image.
is there anyway i check for "fe.image.loaded == true" thing?

11
Hi.
Thanks for helping out.

I had tried a few attempts and eventually i think i found the problem.
I have to first place the images into [snaps] then generate the rom list.
only then the layout will show the image when the game is selected.

if i generate the list and then place images into the [snaps] folder then it will not show.
which is a bit odd.

12
Scripting / Re: File & Directory functions?
« on: June 07, 2015, 07:20:34 AM »
Thank you.
could you have a look at my other post?
http://forum.attractmode.org/index.php?topic=227.0

13
ok... here's one thing i faced.

i have the original artwork folder "snap" pointed to a path say "c:\snap" and i had placed 3 images into it.
Now i wanted to add these artwork into the screen using the code below:
Code: [Select]
fe.add_artwork("snap");but nothing came out or displays.
i do have 3 files placed into the ROM folder and generated the list with the same name, such as "mario.gen" (inside ROM folder) & "mario.jpg" (inside SNAP folder)
but the screen will not show anything at all.
Where did I do wrong?

14
General / Re: Beginner's Quest
« on: June 06, 2015, 12:56:39 AM »
thank you

15
Scripting / File & Directory functions?
« on: June 06, 2015, 12:55:53 AM »
1. How do i check if the file exist? (in c# File.exist("image.jpg"))

2. How do i get a list of files in that particular folder (directory.getFiles(), returns an array of full filepath)


Pages: [1] 2