Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

class TileMap extends Map
{
public Image[] tileImg = new Image[210];

public static final String map_data_file[]={
"map/01_map.dat","map/02_map.dat","map/03_map.dat","map/04_map.dat","map/05_map.dat"
;

public TileMap(int stage)
{

InputStream in = null;
try
{
in = getClass().getResourceAsStream(map_data_file[stage%25]);
load(in);
getTileResource(stage);
} }

void getTileResource(int stage)
{
InputStream is = null;
try
{
is = getClass().getResourceAsStream("/res_mixer/TileresMix.dat");
byte[] imgBuf = new byte[is.available()];
is.read(imgBuf);
is.close();

This is my j2me code....
can i perform this same operation in BREW....

of course you can :D

of course you can :D

I was sooo tempted to write the same answer, Ronin, but I bit my lip and didn't do it.... :)

I was sooo tempted to write the same answer, Ronin, but I bit my lip and didn't do it.... :)

Yes you can, but you will have to use the special compiler switches that enable J2ME CLDC 1.1 MIDP2.0 compatibility. They are "-j -RTFM -ROTFL".
Good luck!
;) :rolleyes: :p

Yes you can, but you will have to use the special compiler switches that enable J2ME CLDC 1.1 MIDP2.0 compatibility. They are "-j -RTFM -ROTFL".
Good luck!
;) :rolleyes: :p

if you are using 1.x, then you are limited to IIMAGE and such, if you are using 2.x, you can possibly use ISPRITE... there is a sample program here:
https://brewx.qualcomm.com/brew/sdk/download.jsp?page=dx/samplecode
did you ever get around to debugging the code in your other posts? it would probably be much easier if you put the images in a resource file (.bar), and loaded them with ISHELL_LoadResImage().. but otherwise, IFILE and IMEMASTREAM are probably the way you need to approach the problem.
-Tyndal

if you are using 1.x, then you are limited to IIMAGE and such, if you are using 2.x, you can possibly use ISPRITE... there is a sample program here:
https://brewx.qualcomm.com/brew/sdk/download.jsp?page=dx/samplecode
did you ever get around to debugging the code in your other posts? it would probably be much easier if you put the images in a resource file (.bar), and loaded them with ISHELL_LoadResImage().. but otherwise, IFILE and IMEMASTREAM are probably the way you need to approach the problem.
-Tyndal