Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Gage editor update  (Read 2582 times)
0 Members and 1 Guest are viewing this topic.
Offline krypto

Junior Devvie




while(true) { self.caffeinate (); }


« Posted 2003-05-27 09:47:25 »

The Gage Editor is shaping up. I can now add tiles and draw on the map, as well as toggle a grid on and off.
However When I try to "erase" a tile, set it to Zero, it dissappears for a minute, then when I redraw the map the old tile appears again. I do a clearRect then fillRect on the Rectangle. Then i set the tile to zero. But the old tile reappears.

Also(JBanes) would it be possible to open up the Gage API by making some of the member variables protected vs. private so that subclassing some of the classes would be more useful.

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline krypto

Junior Devvie




while(true) { self.caffeinate (); }


« Reply #1 - Posted 2003-05-27 14:36:39 »

surely someone knows the answer to this. Cry

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2003-05-27 14:43:22 »

I've never used Gage before, but is it buffering the old image internally in the map?

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline krypto

Junior Devvie




while(true) { self.caffeinate (); }


« Reply #3 - Posted 2003-05-27 14:54:14 »

Quote
is it buffering the old image internally in the map?
Yes but I am resetting the value in the map, prior to the next render call.

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2003-05-27 15:07:38 »

Sorry, just felt sorry for you.. Smiley

Is it possible the buffer is redrawn between you clearing the rectangle and settings the tile to 0?

Can you dump out the data from the map to check whether its actually been set to 0 afterwards?

Kev

Offline krypto

Junior Devvie




while(true) { self.caffeinate (); }


« Reply #5 - Posted 2003-05-27 15:29:33 »

Yes I indeed verify that the tile is set correctly, All other tiles work fine. just the 0th tile (Says don't draw in gage) since nothing is redrawn in main render loop old tile remains. Even after clearRect/fillRect

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #6 - Posted 2003-05-27 15:46:04 »

Sorry for it taking so long for me to reply to this. I was going to make sure my email box was open first (some virus has been super-spamming me and I'm having trouble keeping my box below quota), but I decided I need to stop everyone from wasting their time.

If you had scrolling in your map editor, the problem would become immediately apparent. As soon as the tiles would move, you would see "smearing" where the now empty tiles are. The reason for this is optimizations. GAGE is designed for use by high speed games. As a result it uses a VolatileImage as the backbuffer for the maps. For speed, GAGE doesn't bother clearing the background before painting a new frame. So, what's the answer? Well, the primary way of handling empty tiles is to have a background image or a Map that has no holes. Another option is to change the Map class to clear the background of the lowest map in a stack. This would allow the holes to show through without issue. It's not a change I would recommend using in a game (kind of slow), but it will work for a map editor.

As for the API changes you want. I was going to have you email me a list, but that doesn't seem feasable at the moment. Can you post a desciption of what you want to do here? I'm guessing that changes are unnecessary, but we'll look at them all the same.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline krypto

Junior Devvie




while(true) { self.caffeinate (); }


« Reply #7 - Posted 2003-05-27 16:20:08 »

Thanks for the reply, I will use base map with no holes for now. One thing I wanted to "open up" was the maps storage in Parallax. I want to be able to set reset the order of maps. so that I can effectivly set the z-order. Also I want setWidth and Width on BaseMap.

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline krypto

Junior Devvie




while(true) { self.caffeinate (); }


« Reply #8 - Posted 2003-05-27 16:22:45 »

Also how could I clear the VolatileImage in Map since it is private?

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #9 - Posted 2003-05-27 16:52:31 »

For these types of changes, you should roll GAGE2D into your source tree and make the modifications directly. It sucks, but features such as viewport resizing and Parallax control would muddy up the API for games.

One way of setting a new viewport size is to create a new Map object, then copy the data from the old one into the new one. To clear the VolatileImage, use the graphics context for that Image that GAGE aquires. i.e.:

bufferg.clearRect(0, 0, buffer.getWidth(null), buffer.getHeight(null));


Java Game Console Project
Last Journal Entry: 12/17/04
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline krypto

Junior Devvie




while(true) { self.caffeinate (); }


« Reply #10 - Posted 2003-05-27 17:00:44 »

JBanes;
That's what I thought, Thanks for your patience. Smiley

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (143 views)
2017-09-30 02:57:34

theagentd (206 views)
2017-09-26 18:23:31

cybrmynd (290 views)
2017-08-02 12:28:51

cybrmynd (282 views)
2017-08-02 12:19:43

cybrmynd (292 views)
2017-08-02 12:18:09

Sralse (282 views)
2017-07-25 17:13:48

Archive (950 views)
2017-04-27 17:45:51

buddyBro (1088 views)
2017-04-05 03:38:00

CopyableCougar4 (1653 views)
2017-03-24 15:39:42

theagentd (1413 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!