Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: ArcadeBliss on October 07, 2015, 10:21:46 AM
-
Just wondering if it is possible to change the location where the "skewing" works.
for example
img.skew_y = 20;
will move the top-right and bottom-right of an image down by 20 pixels.
How can I tell attractmode to instead, skew the top-left and bottom-left of the image?
Thanks
-
you might have already figured this out, but use negative values to skew or pinch in the opposite direction.
-
yes this moves the skew in the other direction but I want the side of the object that skews to be the left instead of the right side.
Edit: attached a test layout and picture from Attractmode to demonstrate the issue. the square is only skewed up or down from the right side instead of alternatively on the left. Is it possible?
-
I think I see what you are saying. You are looking at it as skewing from only one direction - which I guess it is. However, you should still get the same shape, just higher than you wanted since the "wrong" side is skewed. Adjusting the y position on your object to compensate should put it back in place with the same shape you want.
Now that could be an issue if you want it at the bottom edge of the screen, because there might not be enough room to adjust for the skew. Also if you are animating the value it'd be more tricky ( skew and move y to adjust ).
Optionally would flipping it ( horizontally? ) giving a mirror image give you that result? My geometry skills aren't up to snuff :) Although that wouldn't be very useful assuming you might be putting a texture on it.
You might wanna take a look at this:
https://github.com/mickelson/attract/issues/70
It's difficult to explain, perhaps you can do a quick paint job or something to mock out the desired shape you are going for?
edit: are we going for "coverflow" here?? considering you were also asking about the conveyor module :)
-
Yes this is correct. I could just raise it. But I need to always figure out how high I should raise the image based upon the height and width when it is not a square. Just ugly math I would rather not have to do.
I already tried flipping the image, but it did not work as you proposed.
Good find with the issue. That explains what I need exactly.
No I am not looking for coverflow but I am trying to do transformation on the object as it moves along the "conveyour".
Any other ideas? Thanks alot for your help.
-
I would go ahead and add your concerns to the issue. If you are just doing a negative skew_y, you should just need to adjust y by the absolute value of the skew I think (skew_y = -20, y = current_y + abs(skew_y) which shouldn't be difficult. If you are also rotating or doing other things that affect the y coordinate, then it's gonna get more complicated.
I'd need to see a little more to help any further - code or picture or more detailed explanation. I'm still not sure exactly what you need it to do and how the skew affects that.
-
Attached is a draft of what am trying to achieve in Attractmode (ignore the backward "TITLE" on the right side image") . It is not possible because I am unable to tell attractmode which edge of the image should be skewed. Bummer.
I will add my comments to the feature request as well.
Just a recap of how skew, and pinching of an image currently works:
If skewing the y axis of an image, the right side of the image will move either move up or down.
If pinching the y axis of an image, the right side of the image will expand or contract.
To make my layout work, I need a combination of skewing and pinching and the ability to tell attractmode to skew or pinch the left side of the object (or the right side when needed).
Thanks for all your help.
Cheers.
-
Looks great! Are you trying to make the left-right objects transform to the center one during the transition with conveyor?
I maybe wrong but I still think it should be doable. I do understand the complaint, though. If it's animating in conveyor it'd need some calculations to readjust y/skew/pinch. I can take a stab at it soon.. is each of those objects a ConveyorSlot, and is it drawn on its on surface?
-
wow you want to have a stab at it? At least let me give you what I have done so far.
- yes each item is in the conveyour and it is a surface object (so skewing the individual objects is easier)
- please ignore some of the unfinished things such as not muting the video of the other objects, etc... Wanted to solve the skew issues first.
Cheers...
-
The game title is not matching the snap. The image for the correct snap is one to the left...
Adventure Maze Craze River Raid
Maze Craze Picture River Raid Picture Tapper Picture
-
Hey!
Here is something to keep in mind as well. Skewing a surface is still somewhat bugged if you try to scale the layout from the lowest screen aspect to the highest. For example, if you create a 1024x768 layout then code it to scale up to 1080p you might find the skewing to be a little off. It's not too bad but noticeable, so masking it with an image overlay can help.
Also, off the top of my head, theoretically you should be able to clone the surface of the primary object then reverse the values on the cloned surface. But, I'm not sure because I'm trying to do this in my head or would I have to rotate the cloned surfaced 360. Puk, I don't know, I think its one of those things you actually have to do.
This is a cool concept though.
-
The game title is not matching the snap. The image for the correct snap is one to the left...
Adventure Maze Craze River Raid
Maze Craze Picture River Raid Picture Tapper Picture
Yes, this was on of the bugs I was going to tackle after finding a solution to the skew. After looking through the AM code, skew is handled using a shader. I tried finding an implementation that would achieve what I was looking for and hit the wall called - "Hell, I don't know how to code"