Poster "minigame"

Hi again! I made a post about this around a week ago and after MUCH trial-and-error I have finally found a system I like for both the “inventory” and the poster pinning “minigame” I was developing for my game. However, I have one small issue I am still trying to hammer out.

When “holding” the poster, it follows the mouse’s coordinates to show you where it will drop- or, in the case of the minigame, where you will be spawning or “pinning up” a new poster. However, the minigame involves zooming into the board in order to place them, which has proven problematic when it comes to actually placing the posters.

The poster is offset pretty far to the right, which makes it difficult to spawn them in via click since you have to move the mouse entirely off of the game screen in order to even see it. Although I can manage to spawn a few, it isn’t really the effect I was hoping for and using number blocks to manually change the position of the poster (Mouse X,Y - #) was not helping.

I assume it has to do with the act of zooming in messing with the in-game mouse coordinates or somewhat confusing it, but is there a solution to this? How can I communicate to the poster that it’s working in a smaller space? Any help is appreciated, thank you for your time as always! :slight_smile: <3

WAD to move
SPACE to zoom in on the poster board
ESC to zoom out
CLICK to pick up/drop items, or to pull them out of inventory
Q to open inventory (Must be closed to drop item)
E to interact with characters (If you get bored lol)
Drop the poster on the jar of slime to make it “sticky” before you start pinning them up!

Skimmed through this, my phone is just about to die (2%)
From what I read, sounds like you’re having issues with mouse position and zoom. Yeah that’s a common issue, though I believe JR01 has an example for this somewhere

2 Likes

Code:

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":5,"outputCount":2,"name":"Mouse to Zoom","behaviorType":"logic.NodeGroup","x":-810,"y":160,"group":"a199d52dde839844","id":"c5cf5b0948cb7a4d","notes":"If the mouse position is off, reload this game after setting the Screen size.","n_o":0,"isMenuItem":false},{"inputCount":0,"outputCount":2,"name":"MouseMove","behaviorType":"logic.triggers.MouseMove","x":360,"y":-128,"group":"c5cf5b0948cb7a4d","id":"c5cf5b098f9f3248","gameCoords":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":540,"y":64,"group":"c5cf5b0948cb7a4d","id":"c5cf5b09b909e64a","portId":"c5cf5b0948cb7a4di0","tag":"Width","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":540,"y":128,"group":"c5cf5b0948cb7a4d","id":"c5cf5b09498c0849","portId":"c5cf5b0948cb7a4di1","tag":"Height","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":540,"y":192,"group":"c5cf5b0948cb7a4d","id":"c5cf5b09ce869746","portId":"c5cf5b0948cb7a4di2","tag":"Cam X","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":990,"y":-128,"group":"c5cf5b0948cb7a4d","id":"c5cf5b093475b841","portId":"c5cf5b0948cb7a4do0","tag":"X","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":990,"y":64,"group":"c5cf5b0948cb7a4d","id":"c5cf5b091370cb4e","portId":"c5cf5b0948cb7a4do1","tag":"Y","dataType":2},{"expression":"(A*(100/D)-((((B*32)*(100/D))/2)-(B*16)))+C","default0":0,"default1":28,"default2":0,"default3":100,"default4":0,"default5":0,"params":4,"version":2,"tag":"","inputCount":5,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":810,"y":-128,"group":"c5cf5b0948cb7a4d","id":"c5cf5b0a43245043","notes":"((Mouse X/Y) * Zoom Multiplier - (Screen Length/Width) * Zoom Multiplier /2 - (Screen Length/Width) /2 ) + Camera Offset\r\n \r\nZoom Multiplier = 100/Zoom","n_o":1},{"expression":"((A*(100/D))-((((B*32)*(100/D))/2)-(B*16)))+(C)","default0":0,"default1":21,"default2":0,"default3":100,"default4":0,"default5":0,"params":4,"version":2,"tag":"","inputCount":5,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":810,"y":64,"group":"c5cf5b0948cb7a4d","id":"c5cf5b0a646cf545"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":540,"y":-128,"group":"c5cf5b0948cb7a4d","id":"c5cf5b0aeef62b48","startVal":0,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":540,"y":-32,"group":"c5cf5b0948cb7a4d","id":"c5cf5b0a3cc7034f","startVal":0,"roundMode":1},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":360,"y":-32,"group":"c5cf5b0948cb7a4d","id":"c5cf5b0a542fab4e"},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":540,"y":256,"group":"c5cf5b0948cb7a4d","id":"c5cf5b0a9931f949","portId":"c5cf5b0948cb7a4di3","tag":"Cam Y","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":540,"y":320,"group":"c5cf5b0948cb7a4d","id":"c5cf5b0a426a0249","portId":"c5cf5b0948cb7a4di4","tag":"Zoom","dataType":2}],"links":[{"input_id":"c5cf5b0aeef62b48i0","output_id":"c5cf5b098f9f3248o0"},{"input_id":"c5cf5b0a3cc7034fi0","output_id":"c5cf5b098f9f3248o1"},{"input_id":"c5cf5b0a43245043i1","output_id":"c5cf5b09b909e64ao0"},{"input_id":"c5cf5b0a646cf545i1","output_id":"c5cf5b09498c0849o0"},{"input_id":"c5cf5b0a43245043i2","output_id":"c5cf5b09ce869746o0"},{"input_id":"c5cf5b093475b841i0","output_id":"c5cf5b0a43245043o0"},{"input_id":"c5cf5b091370cb4ei0","output_id":"c5cf5b0a646cf545o0"},{"input_id":"c5cf5b0a43245043i0","output_id":"c5cf5b0aeef62b48o0"},{"input_id":"c5cf5b0a43245043i4","output_id":"c5cf5b0aeef62b48o0"},{"input_id":"c5cf5b0a646cf545i0","output_id":"c5cf5b0a3cc7034fo0"},{"input_id":"c5cf5b0a646cf545i4","output_id":"c5cf5b0a3cc7034fo0"},{"input_id":"c5cf5b0aeef62b48i1","output_id":"c5cf5b0a542fab4eo0"},{"input_id":"c5cf5b0a3cc7034fi1","output_id":"c5cf5b0a542fab4eo0"},{"input_id":"c5cf5b0a646cf545i2","output_id":"c5cf5b0a9931f949o0"},{"input_id":"c5cf5b0a43245043i3","output_id":"c5cf5b0a426a0249o0"},{"input_id":"c5cf5b0a646cf545i3","output_id":"c5cf5b0a426a0249o0"}]}}}

input screen width, hight, camera position x,y and the zoom, and it will give you updated mouse position

1 Like

ahhh thank you so much!!

Ok so I’m still having issues with it- almost certainly user error but if anyone has a chance to take a look let me know! :sob:

1 Like

… You need to change the value of the zoom if the zoom is changing…

the zoom is the only point of that bundle

I had it updating in the moment when it zooms in- since it isn’t permanent I thought that would be easier than using it throughout the game. Is it better to use it across the board for mouse movements in this object, or do I just need to feed it the original zoom at the beginning? I might be misunderstanding.

Now the zoom → mouse position is not in there at all… It’s hard to give you working code automaticly without it already being in there to some degree because of all the messages and stuff that I don’t know where it’s coming from