JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Nov 8, 2019 14:28
thanks i will try this out
Nov 8, 2019 14:20
ohh ok
Nov 8, 2019 14:13
right
Nov 8, 2019 14:12
oh
Nov 8, 2019 14:12
wont draw outside it
Nov 8, 2019 14:12
hmm
Nov 8, 2019 14:11
thanks
Nov 8, 2019 14:11
ohh ok
Nov 8, 2019 14:11
you mean outside the draw function?
Nov 8, 2019 14:07
:/
Nov 8, 2019 14:07
now im also drawing the username constantly
Nov 8, 2019 14:07
thats better indeed
Nov 8, 2019 14:07
ohh right
Nov 8, 2019 14:06
I set px and py to 0 in drawGui.js
Nov 8, 2019 14:06
hmm
Nov 8, 2019 14:05
ohh
Nov 8, 2019 14:05
this is way harder than I expected
Nov 8, 2019 14:05
oh
Nov 8, 2019 14:04
undefined in left top
Nov 8, 2019 14:04
Nov 8, 2019 14:04
still same :(
Nov 8, 2019 14:03
ohh ok
Nov 8, 2019 14:01
nope didnt work for me XD
Nov 8, 2019 14:00
like var data.posX = callX;?
Nov 8, 2019 14:00
and save it in a new variable?
Nov 8, 2019 14:00
so in client.js above the console.log(data) I can create a function lets say: function(callXY) {

}
Nov 8, 2019 13:59
hmm
Nov 8, 2019 13:58
ohh
Nov 8, 2019 13:58
so its not possible to draw the current X and Y positions?
Nov 8, 2019 13:58
oh :/
Nov 8, 2019 13:57
however im trying to draw the X and Y position in drawGui.js
Nov 8, 2019 13:56
the console.log(data) then logs the following: {posX: 288, posY: 272, id: "x8oWnsrOmb76GPPyAAAE", dir: 0, isAnimating: false}
Nov 8, 2019 13:56
only in drawGui.js
Nov 8, 2019 13:56
no
Nov 8, 2019 13:55
I could send all my code if it maybe helps
Nov 8, 2019 13:55
but still undefined
Nov 8, 2019 13:55
I tried var px = client.data.posX;
Nov 8, 2019 13:55
var px = data.posY;
Nov 8, 2019 13:54
but in drawGui.js I have: var px and var py
Nov 8, 2019 13:54
server.on("playerMovement", function(data) {
server.send(data, "playerMovement");
});
Nov 8, 2019 13:54
this is in my server.js
Nov 8, 2019 13:53
all it does is output this: {posX: 288, posY: 272, id: "x8oWnsrOmb76GPPyAAAE", dir: 0, isAnimating: false}
Nov 8, 2019 13:53
yes
Nov 8, 2019 13:52
in client.js
Nov 8, 2019 13:51
I had console.log(data); commented out
Nov 8, 2019 13:51
ok
Nov 8, 2019 13:51
the code or the console output?
Nov 8, 2019 13:50
okay
Nov 8, 2019 13:49
sorry I dont know, im new to this coding
Nov 8, 2019 13:46
hey