Author Topic: Map Editor HELP  (Read 5166 times)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Map Editor HELP
« on: November 25, 2012, 11:50:47 AM »
Since there has been so much asking for a map editor, I'm going to make one. I just need help with one thing:

How do you calculate the positions in the game? This meaning how do you calculate the mouse position and make the entities rendered orient themselves around the middle of your screen?
I've been trying around for 4 hours. I wanted to keep it secret, but it's inevitable :/


Solved(this is java codes!):
Code: [Select]
public int findX(float x) {
return (int) (x * mng.camera.zoom - mng.camera.x * mng.camera.zoom + mng.frameObj.getWidth()/2);
}

public int findY(float y) {
return (int) (y * mng.camera.zoom - mng.camera.y * mng.camera.zoom + mng.frameObj.getHeight()/2);
}

public int findXR(float x) {
return (int) ((x-mng.frameObj.getWidth()/2) / mng.camera.zoom + mng.camera.x);
}

public int findYR(float y) {
return (int) ((y-mng.frameObj.getHeight()/2) / mng.camera.zoom + mng.camera.y);
}
« Last Edit: November 26, 2012, 04:20:01 AM by Aino »

sillytuna

  • Eufloria lacky
  • Administrator
  • Arboreal Being
  • *****
  • Thank You
  • -Given: 58
  • -Receive: 71
  • Posts: 441
  • Eufloria: Yes
Re: Map Editor HELP
« Reply #1 on: November 25, 2012, 11:57:19 PM »
Is this for HD?

If so, pm me your best email (if not the one used to register here) and I'll answer anything you want to know and keep you informed of plans.

Breakord

  • Sapling
  • **
  • Thank You
  • -Given: 14
  • -Receive: 7
  • Posts: 57
  • Eufloria: Yes
Re: Map Editor HELP
« Reply #2 on: November 26, 2012, 12:09:57 AM »
Since there has been so much asking for a map editor, I'm going to make one. I just need help with one thing:

How do you calculate the positions in the game? This meaning how do you calculate the mouse position and make the entities rendered orient themselves around the middle of your screen?
I've been trying around for 4 hours. I wanted to keep it secret, but it's inevitable :/
well,there truely exist some editors for classic mod ,not work very well though...

Timeroute

  • Seed
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 3
Re: Map Editor HELP
« Reply #3 on: November 26, 2012, 05:14:37 AM »
So is this going to be a standalone map editor application, or another Lua "level" that you load that lets you load and edit other maps?

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Map Editor HELP
« Reply #4 on: November 26, 2012, 05:19:30 AM »
So is this going to be a standalone map editor application, or another Lua "level" that you load that lets you load and edit other maps?

This is going to be a standalone Java application which you can run from a .jar file. This should also make it compatible with all operating systems(unless you're running a very special one).