This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 181348 - Absolute tile size is not portable between resolutions, tile count would be more appropriate.
Summary: Absolute tile size is not portable between resolutions, tile count would be m...
Status: NEW
Alias: None
Product: javame
Classification: Unclassified
Component: Game Builder (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: _ kherink
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-01 03:23 UTC by flintza
Modified: 2010-03-01 03:26 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description flintza 2010-03-01 03:23:05 UTC
When specifying new Tiled Layers and Sprites in the Game Builder, the user must specify an image to use and the pixel height and width of tiles in the image. For the sake of multi-resolution portability (where different image resources would be used to accomodate different sizes) it would be better to specify the horizontal and vertical tile count instead.
The resulting generated code would calculate the tile width and height passed to the Sprite and TiledLayer classes using Image.getWidth and Image.getHeight as illustrated below (taken from GameBuilderDemo):
public TiledLayer getWater() throws java.io.IOException {                                 
if (Water == null) {                               
// write pre-init user code here
Image image = getTopview_tiles();
Water = new TiledLayer(8, 6, image, image.getWidth()/16, image.getHeight/7); 
...
}
return Water;
}