Enabling Mouse Picking and Code Maintenance | Coding a 2D Game Engine in Java #32

  Рет қаралды 2,530

GamesWithGabe

GamesWithGabe

Күн бұрын

Пікірлер: 26
@jishanahamed8592
@jishanahamed8592 Ай бұрын
I've been following this series for quite some time now, and this is so great. It's very high quality, and i've learnt more in 2 weeks than i've learnt in 3 months of self study. Thanks a lot
@winterSweet-k4m
@winterSweet-k4m 4 жыл бұрын
Happy 600 already :)
@GamesWithGabe
@GamesWithGabe 4 жыл бұрын
Thanks @W4rd3nclyffe!
@vixellar1541
@vixellar1541 4 жыл бұрын
Congrats on 600 mate, and its good seeing you upload twice a week :D
@GamesWithGabe
@GamesWithGabe 4 жыл бұрын
Thanks Vixellar! And yeah, hopefully I'll be able to start doing two videos a week again starting this week haha
@jishanahamed8592
@jishanahamed8592 Ай бұрын
For anyone facing a problem where if you click anywhere else other than the viewport, the properties window still vanishes, it's because we defined a fixed width and height for our picking texture, for me it was 1920, 1080. And when we are clicking anywhere other than our viewport, the values for "int x = (int)MouseListener.GetScreenX()" and "int y = (int)MouseListener.GetScreenY()" is outside the range of our viewport display(1920, 1080). So to fix this what i did was just add an if statement to check if we are clicking inside the viewport, and only then we will set the activeGameobject. if (!(x < 0 || x > pickingTexture.GetWidth() || y < 0 || y > pickingTexture.GetHeight())) activeGameObject = currentScene.GetGameObject(gameObjectId);
@woarey8800
@woarey8800 Ай бұрын
How exactly do you do this if check? I cant manage to get it to work
@jishanahamed8592
@jishanahamed8592 Ай бұрын
@@woarey8800 buddy I've already written the if check, in the comment. [NOTE: Remember here x and y are the mouse position with respect to the topleft(i think), corner of the viewport] // Only set activeGameObject when x,y is inside the game viewport if (x >= 0 && x = 0 && y
@griffinbrooks6748
@griffinbrooks6748 4 жыл бұрын
Cool! You need more subscribers!
@a.k.8731
@a.k.8731 Жыл бұрын
Enjoyed!💃
@DevsLikeUs
@DevsLikeUs 4 жыл бұрын
Great episode!
@GamesWithGabe
@GamesWithGabe 4 жыл бұрын
Thanks!
@temps1959
@temps1959 3 жыл бұрын
for some reason, when I click on a gameObject the properties window pops up fine, but when i click on the actual properties window, it disappears. If anyone is having a similar problem and could help me out I'd greatly appreciate it.
@GamesWithGabe
@GamesWithGabe 3 жыл бұрын
Hey @Temps! It sounds like your game engine might be intercepting the click event from ImGui or something. I would put a breakpoint inside your mouseEvent function and see if ImGui gets the mouse event or if the engine gets the mouse event. And if ImGui gets the mouse event and handles it, then you want to try and stop the event from propagating to the engine otherwise it will think you clicked a blank space and there's no game object there, so the properties window will disappear since it's trying to display properties for a null game object. Hopefully that makes sense, let me know if it helps out :)
@xCapeGr
@xCapeGr 3 жыл бұрын
Hey :) did you find the solution? Just got to the same point and have the same problem. I'm kinda struggling to find the problem, thank you for your time
@GamesWithGabe
@GamesWithGabe 3 жыл бұрын
@@xCapeGr Hey tseksCape! So I'm guessing your properties window is in front of your game viewport. If your properties window is in front of your gameviewport and you click on it, the game engine thinks you clicked a blank space and then it tries to select the game object there (which is null since there is no game object), then it looks like the property window disappears. Try moving the property window out of the way of the game viewport and see if the problem still happens :)
@npshmear
@npshmear 2 жыл бұрын
@@GamesWithGabe I'm also having this same problem. I am unable to left click on the properties window even when it is not over the game view port window. Spent quite a while trying to debug it. Not sure how to fix it. 😩
@ZR-os5ry
@ZR-os5ry 2 жыл бұрын
@@npshmear Have you managed to fix it ?
@luandkg
@luandkg 4 жыл бұрын
Great 👏🏻👏🏻👏🏻
@matanmigdal7108
@matanmigdal7108 4 жыл бұрын
i am getting error on the cpp repository CDungeonCrawler Severity Code Description Project File Line Suppression State Error LNK2038 mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in CommandHistory.obj JadeEngine C:\matan\CDungeonCrawler\CDungeonCrawler\JadeEngine\Box2D.lib(b2_circle_contact.obj) 1
@GamesWithGabe
@GamesWithGabe 4 жыл бұрын
Hey Matan, I had fixed this in one of the updates to master branch. I just did a clean install of the whole project and it still seems to be working fine. You can either try to do git pull origin master, or do a fresh install and that should fix it
@Jordan4Ibanez
@Jordan4Ibanez 4 жыл бұрын
Hi Gabe :D
@GamesWithGabe
@GamesWithGabe 4 жыл бұрын
What's up @Oil_boi? :)
Editor Camera Controls with Lerp | Coding a 2D Game Engine in Java #33
26:59
The Tyrannical Mods of Stack Overflow
12:15
GamesWithGabe
Рет қаралды 375 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 17 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 29 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 42 МЛН
OpenGL 3D Game Tutorial 29: Mouse Picking
16:03
ThinMatrix
Рет қаралды 93 М.
Mouse Picking // Game Engine series
30:15
The Cherno
Рет қаралды 26 М.
Stop using std::vector wrong
23:14
The Cherno
Рет қаралды 157 М.
anthraxAI game engine (Vulkan API):  mouse picking, gizmo
10:00
sudo love me baby
Рет қаралды 3,3 М.
The Math Behind Font Rasterization | How it Works
16:07
GamesWithGabe
Рет қаралды 173 М.
Preparing Framebuffers for Mouse Picking // Game Engine series
29:02
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 841 М.
I Coded a Video Editor (and it kind of sucks)
18:35
GamesWithGabe
Рет қаралды 237 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 17 МЛН