Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Thanks progres and rand0m for your answers, really!

Yes random, it is what I am looking for, I dont want an unified or mega list of genres.
It was easy to do with your explanation, thanks again!  :) :)
22
Scripting / Re: shuffle-module: First official release
« Last post by keilmillerjr on Yesterday at 03:45:12 AM »
Taken from the readme is an example with three text objects. They are passed as an array to the class constructor. The index of these objects is handled by the class. You place or style the objects however.

You could create 12 text objects with Title as a magic string. Position them in a visually stacked manner. Extend the class select function to make object bold. Now you can see which object is selected. It should operate similar to attract’s built in listbox object, but allows for much more freedom.

// Load the Shuffle module
fe.load_module("shuffle");

// Create your objects
local list = [];
   list.push(fe.add_text("Title", -1, -1, 1, 1));
   list.push(fe.add_text("Title", -1, -1, 1, 1));
   list.push(fe.add_text("Title", -1, -1, 1, 1));

// Create an instance of the Shuffle class
// Shuffle(slots, type, reset=true)
local list = Shuffle(list, "text");

Best I can do on iPhone until Saturday. Feel free to hit me up on discord if you need to.
23
Scripting / Re: shader-module: First official release
« Last post by zpaolo11x on Yesterday at 02:37:52 AM »
Turns out most of this stuff is not always needed for a good gaussian blur, I'll have to check better but you don't need the two surfaces to get the effect. One simple code that does a good gaussian blur is this:

Code: [Select]
local flw = fe.layout.width
local flh = fe.layout.height

local showsize = flw*0.5
local buildsize = 30

local surf1 = fe.add_surface (buildsize,buildsize)
local pic1 = surf1.add_artwork("snap",0,0,buildsize,buildsize)
pic1.video_flags = Vid.ImagesOnly

local pic3 = fe.add_artwork("snap",showsize,0,showsize,showsize)
pic3.video_flags = Vid.ImagesOnly

local blursize = 1.0/(buildsize*1.0)

local shaderH1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma_o.glsl" )
shaderH1.set_texture_param( "texture")
shaderH1.set_param("kernelData", 9.0, 2.2)
shaderH1.set_param("offsetFactor", blursize, 0.0)
surf1.shader = shaderH1


local shaderV1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma_o.glsl" )
shaderV1.set_texture_param( "texture")
shaderV1.set_param("kernelData", 9.0, 2.2)
shaderV1.set_param("offsetFactor", 0.0, blursize)
pic1.shader = shaderV1

surf1.set_pos (0,0,showsize,showsize)

When you draw the image on the surface, the image is drawn at the surface resolution so you can just apply shaders to the image and the surface, instead of using two surfaces. Bear in mind though that if you want to add some safeguard areas around the image to blur (e.g. drop shadow) this is not gonna work well and you'll need to step back to the other method.

24
Scripting / Re: shuffle-module: First official release
« Last post by rand0m on Yesterday at 02:34:18 AM »
I chose the name for the module because it “shuffles” indexes through objects. Create an array. Push the objects to the array. For instance, you want 12 text objects on the screen, push 12 objects. You can do this manually, or create a loop for count of 12 to do it. Style the objects. Pass the array to the shuffle class.

If you can’t get it, I’ll provide an example for you on Saturday.

Please do, I can work my way through trial and error with an example. I have looked into previous themes utilizing the shuffle module but the code is obsolete with regards to current version.
25
Scripting / Re: shader-module: First official release
« Last post by zpaolo11x on Yesterday at 01:57:13 AM »
Hey, thanks! I think I managed to trick your set up into working for me! I even tried wrapping up as a module, but it only works once. And that's enough for me. For now. Maybe someday I'll poke around a little more? :) [Something to do with how surfaces are assigned/referenced, I think...]

The way surfaces are referenced is a trick to prevent attract mode from delaying the update of nested surfaces. I think it might be useful if I try to describe how my blur works...

There's only one shader, that can be tweaked with parameters for matrix size, gaussian blulr sigma and an offset vector. The offsect vector should be (0 , 1/height) for the vertical blur and (1/width, 0) for horizontal blur. If this value is not correct you'll end up with artifacts.

The "nominal" surface stack should be like this (this will be changed for a reason, more on that later):

surface1 as base surface,
surface2 inside surface1,
picture inside surface 2

Surface1 and surface2 are the base surfaces to which you'll apply the horizontal and vertical blur shader. They should be of a known width and height and are used not only to stack the shaders, but also to force a downsample of the picture, so regardless of the picture size, you'll always apply the shader to a known size surface. If you are using the blur to generate a drop shadow this base surface should be larger than the picture to avoid clipping.

Then to avoid the delay in AM "actual" picture and surface creation is shuffled a bit so everything is created at the fe.add_ level and later "cloned" inside the surface. That's the way you build your stack is reversed, you have to create first the items that are on top, and create them on the layout level:

- create the topmost surface (surface2) as fe.add_surface etc
- add image to the surface
- create the bottom surface (surface1) as fe.add_surface etc
- add shaders to your surfaces (not to the image)
- use the Oomek trick like this:

surface2.visible = false
surface2= surface1.add_clone(surface2)
surface2.visible = true

surface1.set_pos(actual surface position and size)

the trick allows you to reposition the surfaces, but they will be updated all together since they were created as fe.add_surface and not as surface1.add_surface

The point of all this nesting is to avoid applying the shaders to the image resolution, but to the surface resolution, so you can control that and even use it to downsample.
26
Scripting / Re: shuffle-module: First official release
« Last post by keilmillerjr on Yesterday at 01:07:35 AM »
I chose the name for the module because it “shuffles” indexes through objects. Create an array. Push the objects to the array. For instance, you want 12 text objects on the screen, push 12 objects. You can do this manually, or create a loop for count of 12 to do it. Style the objects. Pass the array to the shuffle class.

If you can’t get it, I’ll provide an example for you on Saturday.
27
Scripting / Re: shuffle-module: First official release
« Last post by rand0m on Yesterday at 12:51:31 AM »

Correct. That is the intended behavior. I had intentions of using it with romlist which would be higher than the array of objects. It does seem weird if your index length is the same as your objects... or less!

Excited for this comment! I wasn't sure if the issue only occurred for myself or others. I think the only way to get around this is to not use attract-mode's signals. I just had a quick look at the conveyor class. I might have to implement something like that to simulate attract-mode's natural indexing. I wanted to stay away from it because other things can receive signals. Manually indexing means I could implement a no loop feature. Will investigate further in two days. Thank you for bringing this to my attention!

I would hope you wouldn't be showing 100 items in a list at the same time. However, you can create a for loop that creates the object and step things sequentially.

I don't want to be showing hundreds of items at the same time but the ability to browse through hundreds of items in a vertical list (plain text) where a dozen or so are visible on screen at any time. Similar behavior to that of AM default.

Is retrorama2 theme (.gif in Shuffle's main github dir) utilizing the said loop? I am stuck on the idea that one slot equals one row so a list, of say 100 roms, will require 100 different slots each with its own placement (manual) instruction. In retrorama2 gif it seems there is a single slot and user can vertically browse through the roms listed in that single slot.

I am sorry for so many Q's but slots/ arrays/ rows all get mixed together for me as I don't have a programming background :D.
28
General / Re: Screensaver showing black screen
« Last post by progets on Yesterday at 12:39:39 AM »
I'm glad to hear you fixed your issue. I did think that the long value was unusual but didn't think it was the issue at the time, now I can see why it might fall outside of expected limits.
29
General / Re: AM hangs on exit from MAME
« Last post by progets on Yesterday at 12:35:50 AM »
I'm glad things are working how you want. It sounds like you just had a bad setting some where.
30
Scripting / Re: shuffle-module: First official release
« Last post by keilmillerjr on Yesterday at 12:30:21 AM »
a) Lets say we have a list of 5 items A,B,C,D & E, with A being the first item in list and E being the last. A is given the spot 100, 100, B 100, 200 till E 100, 500. While we scroll downwards from A and reach E, scrolling down further will move the list to item A but will the same spot (E, 100, 500). It this the intended behavior? Or is the selection area is supposed to move to A (100, 100)? With no looping of indexes will the list stop moving downward from E (100, 500) or jump back to A (100, 100)?

Correct. That is the intended behavior. I had intentions of using it with romlist which would be higher than the array of objects. It does seem weird if your index length is the same as your objects... or less!

b) I am currently using shuffle in displaymenu with only 5 items. It seems that AM function of pressing down for quick scrolling is not being applied, is my list too short for application or shuffle doesn't support that?

Excited for this comment! I wasn't sure if the issue only occurred for myself or others. I think the only way to get around this is to not use attract-mode's signals. I just had a quick look at the conveyor class. I might have to implement something like that to simulate attract-mode's natural indexing. I wanted to stay away from it because other things can receive signals. Manually indexing means I could implement a no loop feature. Will investigate further in two days. Thank you for bringing this to my attention!

c) What about really long lists like e.g. mame romlist. Currently I have to enter manually 5 items in shuffle with their locations, how would that work with 100+ items lists? Is there any other way of applying shuffle in a vertical list with numerous items where we don't have to manually position each row/ slot?

I would hope you wouldn't be showing 100 items in a list at the same time. However, you can create a for loop that creates the object and step things sequentially.
Pages: 1 2 [3] 4 5 ... 10