While using Processing and just pressing 'run', the site looks as it should: when hovering over a specific object, the text is centered within the black bar that appears. It also runs like this perfectly on Firefox, running it off Dropbox as per the link above.
But when I open the above link in Chrome, the text is like 20px above where it should be, so it's not within that little black bar. But the text tabs up the top don't change at all, it's not like ALL the text is being offset. Really weird, how do I fix this?
Like so:
Chrome on Dropbox:
Firefox on Dropbox/Chrome running from Processing (CORRECT):
edit: This seems to be very inconsistent. It sometimes works fine, sometimes has issues. Firefox is always fine though.
So I've got a sketch in P3D in the latest version of Processing. It's got a bit of 3D with some 2D elements overlaid once I call hint(DISABLE_DEPTH_TEST).
Problem is, even though I've got noSmooth() on, it's blurring all my images. Not just the outlines, the entire image is slightly blurred. It's not being upscaled, I'm literally just drawing the .png onto the screen with PImage. What's causing this and how can I stop it?
I've created a program in standard Processing using the Minim library along with some mp3's. I now need to port this over to ProcessingJS, but I've now realised that Minim isn't available for ProcessingJS. Are there any alternatives you can point me towards?
What I need is to be able to:
-play and stop mp3 files (from data folder preferably, otherwise from some URL)
-move around within those mp3 files (ie. skip to :50 seconds in).
How would I implement a fast-forward into my sketch, without losing data? I can't just up the FrameRate because it's running at around 30fps and the max it can run is around 45-50fps, which isn't even 2x. I really need a 4x speed.
I can't see how this is possible, unless I have a variable that makes everything 4x it's original value, but then that would mean losing a lot of data, ie. an 'if (var == 0)', when 'var--;' is running every frame, would end up missing a lot if var is dropping by 4 instead of 1 each frame. Any ideas?
int upgradeLvl - this changes, so it could be anything from 1-5.
int dmg1, dmg2, dmg3, dmg4, dmg5 - these are the values of the damage each class does, "dmg1" refers to the damage at level 1, dmg2 at level 2 and so on. This is so that I can easily manipulate and balance these later.
int dmg - the current dmg of the tower.
finally
String currentDmg = "dmg"+upgradeLvl; At upgradeLvl=1, String currentDmg = "dmg1", etc.
Then I want to go..
dmg = currentDmg (ie. dmg = dmg1, or dmg2, etc. depending the level).
but I can't make an int equal to a String "dmg1", I need it to refer to the variable named "dmg1" and extract the data from that.
Sorry if this is badly explained. Help would be much appreciated.
I'm creating a game where you, a little point, have to run away from other little points, and if they touch you, you die. Pretty standard game format, but I'm having a lot of trouble getting the little points to follow the player.
I've tried:
if (x > targetX) x -= speed;
if (x < targetX) x += speed;
if (y > targetY) y -= speed;
if (y < targetY) y += speed;
But of course that only allows the little points to move in 45 degree angles.
I then tried something like:
x += (targetX - x) * speed;
y += (targetY - y) * speed;
But then the speed of the particles is dependent on the distance between the particle and the player. When they're really far away, they're super fast, when they're really close, they're really slow. I need a constant speed.
Finally I tried trigonometry:
xCalc = xTarget - x; //'bottom' of the triangle, adjacent to angle
yCalc = yTarget - y; //'side' of the triangle, opposite angle
angle = atan(yCalc/xCalc);
This works well along the x-axis, but not at all well along the y-axis. It also doesn't work from 3'o'clock to 6'o'clock, the bottom right quadrant - if the player is in this position compared to the particle, the particle ignores the player. I'm sure this last way is the right way to go but I can't get my head around the maths. Help?
Say I have a grayscale image, and an image with just colour information. How can I overlay the coloured image onto the grayscale image, like you do in Photoshop with the layer set to 'color', and so you get one normal, coloured image. The blend() function doesn't have a colour option - is there another way to do it? The faster the better, FPS is a big concern.