I'm getting multiple errors in Gamemaker in regards to moving the player in a room, and I'm not sure why it is happening - game-maker

Shouldn't this code move the player? It won't animate the player, but it should at least move it...
The top one is when I press Down, the next one is when I press Left, the second from the bottom shows when I press Up, and the last one is when I press Right.
All I want to do is move the player at this point, I'm not going to worry about adding the animations right now. If anyone knows how to help me, I would be extremely thankful!

Update: I just noticed your error codes from the second screenshot now. The issue is likely that you need to turn on physics for the room/object.
Original reply:
What if instead of trying to set phy_position_x/y directly, which GM recommends against, you set the phy_speed_x/y? So for instance move right/left would look like this:
if moveRight
{
phy_speed_x = spd;
}
if moveLeft
{
phy_speed_x = -spd;
}
You may need to have "phy_speed_x = 0;" before the if statements to keep the object from moving when no button is pressed. I don't use the built-in physics system myself so I have not tested this.

Related

Qt 3D Studio Animating only one element in a slide, while keeping other elements stay where they are

I am working on a project with Qt 3D Studio, I have a concern regarding animating single objects in slide, while rest of the objects are not effected.
To explain, let's consider three Slides "MoveCarRight", "MoveCarCenter" and "SignNoRight". (Please see attached picture to give you idea about my scene.)
"MoveCarRight" is used for moving car to right, "SignNoRight" is used for animating traffic sign on the Z axis so that it enters the scene.
I control those slides from QML side by entering:
presentation.goToSlide("Scene","MoveCarRight")
presentation.goToSlide("Scene","SignNoRight")
However, inevitably I can't control the objects seperately. When I go to slide "SignNoRight", I want the car to stay the same, if it was previously moved to center, it should stay at the center, if it was previously moved to right, it should stay right. Right now, when I enter "SignNoRight" it is always centered.
I would think there would be a simple solution to this, yet I couldn't find it. Any help is greately appreciated. Thanks in advance.
I have solved my problem with the introduction of data input controllers. See example: https://doc.qt.io/qt3dstudio/openglruntime/qtstudio3d-qmldatainput-qml-qmldatainput-main-qml.html

FullCalendar timeGridWeek dragging or selecting time slot stops working towards end of day

I am using Fullcalendar timeGridWeek side by side with dayGrid.
I can drag between the two and resize or drag in the timeGridWeek (the one on the left).
However, the problem is functionality is broken after hour 6PM or towards the end of the day, depending on the screen width.
I've also enabled clicking on time slot. I can click until 13:00. Anything after that stops working.
If I set the #container > * element to 1600px (on my ultrawide display) everything works correctly.
I can't figure out why.
I also have this running in a React App with MaterialUI and it behaves in the same way. I presumed it was something to do with the theme, but now can see it does the same thing with minimal styling.
Codepen: https://codepen.io/anon/pen/exabpW?editors=0010
This might come from the businessHours option, at pair with the eventConstraint: 'businessHours' option, which, if both are set together, disallow dragging and moving outside businessHours.
So the way to patch it would be to remove the eventConstraint option if u placed it, or change your businessHours
Apparently it's a confirmed bug: references here
https://github.com/fullcalendar/fullcalendar/issues/4503
and here
https://github.com/fullcalendar/fullcalendar/issues/4505

qt: after moving window off-screen, how to move it back to default position, including default positioning behaviour?

[qt 4.8]
To get correct window dimensions including its frame, I do the following (as described e.g. here, see comment from Daniel Hedberg).
mainWindow.move(-50000, -50000);
mainWindow.show();
// do something with the window dimensions
mainWindow.move(0, 0);
mainWindow.show()
This works fine, however, I have a problem with the move(0,0) call: It makes the window always appear at position (0,0), while I would like to have the default behaviour, this is, the application only suggests to the window manager that (0,0) is a good place to position the window, and the WM might decide to shift it if necessary to avoid overlapping. In other words, I would like to switch back to Qt's default behaviour as if there weren't a call to move at all.
How can I do that?
One solution is to store Windows original position and use that. For extra safety (in case screen resolution changes), check that entire window still fits on screen and move and even resize if it does not.
A hacky alternative would be to create and open empty, possibly transparent dummy window of the same size and see where it gets positioned. Then move the original there and close the dummy one. Reading your question carefully, I think this would do what you are after.
I don't know of a Qt way to ask Window Manager to reposition the window, so if you really need that, specify the OS etc details.
Looking into the source code of Qt, I can now partially answer my own question: To convert a call to move into a suggestion for positioning instead of a request, do this:
mainWindow.move(100, 100);
mainWindow.setAttribute(Qt::WA_Moved, false);
mainWindow.show();
I've tested the code under X11 using Qt 4.8.4, and hopefully it works with on other platforms too.
Unfortunately, this doesn't solve the very problem I have, namely to use show to get the (decorated) dimensions of an off-screen window which then gets moved to the screen, calling show again. It seems that the first call to show directly sets platform-specific window manager flags which aren't completely reset and reevaluated in the second call. Actually, I'm going to think that this is a bug in Qt, so I'll report it accordingly.

Change hotspot of mouse cursor on a web page

I would like to change the hotspot of a mouse pointer, which we've changed the icon using a .cur file, to be in the bottom right of the image, rather then the top left.
Pretty much like an inverted arrow cursor, the designers/boss have come up with a nice design which almost requires this.
Is it possible to change the hotspot of a mouse cursor on a web page?
I have not tested it, got it from developer.mozilla.org:
Support for the CSS3 syntax for cursor values got added in Gecko 1.8beta3; it therefore works in Firefox 1.5. It allows specifying the coordinates of the cursor's hotspot, which will be clamped to the boundaries of the cursor image. If none are specified, the coordinates of the hotspot are read from the file itself (for CUR and XBM files) or are set to the top left corner of the image. An example of the CSS3 syntax is:
cursor: url(foo.png) 4 12, auto;
Link to CCS3 cursor
It's not possible, and I'm glad - I think you'd only frustrate your users with this.
Edit: I was wrong - I didn't think this was possible - I still don't think you should do it though.
You can't. And as most people here I'd tell you to not do it even if you could...
However, I could imagine something like this for very specific cases like the page of some artist, or for a game cursor, or a sort of 3D-like map with the cursor pointing down. Now if you really need a special cursor for a media oriented site, as opposed to an information site, I'd hide the cursor, with a blank cursor file and use some Javascript to attach a floating image over the cursor so it "looks like" the hot spot is someplace else.
Of course your sites usability and compatibility will go way down, but the solution above is if you really need to take the creative liberty, and your users are open minded to this sort of stuff.

Moving a Flex GUI window confused by underlying Papervision3D viewport

I'm developing a Flex 2 application, and I noticed that part of the library which is responsible for moving GUI windows (TitleWindows) around when you drag them with the mouse gets confused if there is a clickable (buttonMode = true) sprite beneath them. When I say confused, I mean that the window is moved around normally for a while, but then at some point "jumps" into the upper left corner of the flash app, and makes very minor movement there. Then at some other point it jumps back. It is more difficult to explain than to experience, so please go and see for yourself. Here's how to reproduce the problem:
Go to http://www.panocast.com
In the left sidebar, choose "Real Estate"
Just below the bottom right corner of the flash window, choose "high res" by clicking on the rightmost icon.
When (part of) the video loads, click on the staircase. A TitleWindow will pop up.
Try dragging it around the screen. When the mouse cursor is moved above one of the clickable areas (like the staircase), the window is misplaced.
(Sorry, but can't give you a direct link, part of the page is generated dynamically.)
(What's makes the problem even more interesting is that for me, in "low res" mode, the problem does not occur! There is very little difference between the various modes.) I would really appreciate if someone told me what was going on here and how it can be fixed.
I'm not sure if it matters, but the underlying sprite is actually not just plain sprite, rather it is a Papervision3D renderer object with some 3D elements in it. I'm telling this because it is possible that the incorrect mouse coordinates somehow come from the texture UV mapped on the clickable objects.
I've managed to replicate this on the low res mode as well, so I don't think it's related to the resolution.
This looks to be because the MouseEvent is being handled by the TitleWindow AND the Papervision3D window. Perhaps you need to force stopImmediatePropagation() on one or the other? Or maybe switch off the MouseEvent handling for the Pv3D window when the TitleWindow pops up?
That's a tough one to debug without some source; something's apparently calling either move() or setting x and y properties on that TitleWindow and scheduling it be moved.
When I first read the post, it "smelled" like maybe a rotation miscalculation somewhere (using Math.atan vs. Math.atan2 can sometimes have that kind of effect), so you're right, it could have something to do with PaperVision, assuming you're not using Math.atan or setting rotation properties yourself anywhere. Just thought I'd mention it, though it's probably not happening in your case. You never know, though. ;)
More likely the LayoutManager is moving the component in response to a property change on the component. The Flex docs explain that in addition to setting its x and y properties, and explicit calls to move(), a UIComponent's move event can also be triggered when any of the following other properties change:
minWidth
minHeight
maxWidth
maxHeight
explicitWidth
explicitHeight
PaperVision or no, maybe that info might help you isolate the source of the move. Good luck.
I got this figured out. Apparently, this is a Papervision3D problem. There is a class deep inside Papervision3D called VirtualMouse, which is supposed to generate MouseEvents programmatically. This happens, for example, when the user interacts with any of the interactive objects on stage, e.g., a Plane with an interactive material on it (as in my case).
The problem is that the x and y coordinates of the generated event represent texture UV coordinates (just as I suspected) and not real world screen coordinates. When a TitleWindow (or any Panel object) is dragged, a "mouseMove" handler (among others) is added to the SystemManager, which then uses the stageX and stageY properties of the event object to determine the new position of the window. Unfortunately for VirtualMouse's mouse events, these are invalid, since the original x,y coordinates, which are probably used to determine the global stage coordinates are, as I said, not screen coordinates.
Honestly, I'm still unsure whether the events dispatched by VirtualMouse are used anywhere within Papervision3D itself, or they are just offered for convenience, but they sure make it difficult to integrate a viewport into a Flex program. Assuming that such events aren't necessary for PV3D itself, there is a one-liner fix for my problem, which must be added right after the creation of the viewport:
viewport.interactiveSceneManager.virtualMouse.
disableEvent(MouseEvent.MOUSE_MOVE);
BTW., there was a very similar (or rather, as it turns out, the same) bug with dragging sliders, also fixed by this line.

Resources