Problems compiling a .dol August 18, 2010 01:19AM | Registered: 13 years ago Posts: 12 |
Re: Problems compiling a .dol August 18, 2010 04:37AM | Registered: 15 years ago Posts: 175 |
Re: Problems compiling a .dol August 18, 2010 07:56AM | Registered: 13 years ago Posts: 12 |
Re: Problems compiling a .dol August 18, 2010 06:00PM | Registered: 15 years ago Posts: 175 |
xpos Specifies the x-coordinate of the upper-left corner. ypos Specifies the y-coordinate of the upper-left corner. tex The texture to draw. degrees Angle of rotation. scaleX Specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally. scaleY Specifies the y-coordinate scale. -1 could be used for flipping the texture vertically. color Color in RGBA format.In your code you wrote:
GRRLIB_DrawImg(posx, posy, spr_oscright_width, spr_oscright_high, spr_oscright_img, 0, 1);It does not seems accurate.
Re: Problems compiling a .dol August 19, 2010 12:39AM | Registered: 13 years ago Posts: 12 |
Re: Problems compiling a .dol August 19, 2010 07:43AM | Registered: 15 years ago Posts: 175 |
OscImg imgOsc; imgOsc.texture = GRRLIB_LoadTexture(spr_oscright_img);Call GRRLIB_LoadTexture in your constructor or something ...
Re: Problems compiling a .dol August 21, 2010 12:37AM | Registered: 13 years ago Posts: 12 |
#include "player.h" #include "img/spr_oscright.h" typedef struct OscImg { GRRLIB_texImg * texture; } OscImg; OscImg imgOsc; objOscar::objOscar () //: faith(10.0), xspeed(0), yspeed(0), hand(false) { imgOsc.texture = GRRLIB_LoadTexture(spr_oscright_img); posx=(256/2); //X posy=(240/2); //Y } objOscar::~objOscar() { } void objOscar::handed() { hand=true; } bool objOscar::draw() { GRRLIB_DrawImg(posx, posy, imgOsc.texture, 0, spr_oscright_width, spr_oscright_high, 0xFFFFFFFF); return true; };
Re: Problems compiling a .dol August 21, 2010 12:49AM | Registered: 15 years ago Posts: 175 |
Re: Problems compiling a .dol August 21, 2010 02:36AM | Registered: 13 years ago Posts: 12 |
Re: Problems compiling a .dol August 21, 2010 03:37PM | Registered: 15 years ago Posts: 175 |
Re: Problems compiling a .dol August 22, 2010 07:11PM | Registered: 13 years ago Posts: 12 |
#ifndef __PLAYER_H__ #define __PLAYER_H__ class objOscar { public: objOscar(); ~objOscar(); int diamonds; void handed(); void update(); bool draw(); private: int score; double faith; int xspeed, yspeed; int posx, posy; bool hand; u16* imgOscar; }; #endif
Re: Problems compiling a .dol August 22, 2010 07:59PM | Registered: 15 years ago Posts: 175 |
typedef struct OscImg { GRRLIB_texImg * texture; } OscImg; OscImg imgOsc;Whit this in the main():
imgOsc.texture = GRRLIB_LoadTexture(my_img); // ... GRRLIB_DrawImg(10, 60, imgOsc.texture, 0, 1, 1, 0xFFFFFFFF);And every thing worked like a charm.
/** * This file was autogenerated from spr_oscright.png by WiiBuilder. */ //--------------------------------------------------------------------------------- #ifndef _spr_oscright_h_ #define _spr_oscright_h_ //--------------------------------------------------------------------------------- const unsigned char spr_oscright[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xAC, 0x08, 0x06, 0x00, 0x00, 0x00, 0x87, 0x29, 0x65, ... }; const int spr_oscright_size = 45111; //--------------------------------------------------------------------------------- #endif //_spr_oscright_h_ //---------------------------------------------------------------------------------
Re: Problems compiling a .dol August 24, 2010 01:14AM | Registered: 13 years ago Posts: 12 |
#include#include "player.h" #include "img/spr_oscright.h" /*typedef struct OscImg { GRRLIB_texImg * imgOsc; } OscImg; OscImg imgOsc;*/ GRRLIB_texImg * imgOsc; objOscar::objOscar () { posx=(256/2); //X posy=(240/2); //Y } objOscar::~objOscar() { } void objOscar::handed() { hand=true; } bool objOscar::draw() { imgOsc = GRRLIB_LoadTexture(spr_oscright); GRRLIB_DrawImg(posx, posy, imgOsc, 0, spr_oscright_width, spr_oscright_high, 0xFFFFFFFF); return true; };
#include#include #include #include #include #include #include #include #include "player.h" int main(int argc, char **argv) { // Initialise the Graphics & Video subsystem GRRLIB_Init(); // Initialise the Wiimotes WPAD_Init(); objOscar Oscar; // Loop forever while(1) { WPAD_ScanPads(); // Scan the Wiimotes // If [HOME] was pressed on the first Wiimote, break out of the loop if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) break; // --------------------------------------------------------------------- // Place your drawing code here // --------------------------------------------------------------------- //Oscar.update(); Oscar.draw(); GRRLIB_Render(); // Render the frame buffer to the TV } GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB exit(0); // Use exit() to exit a program, do not use 'return' from main() }
Re: Problems compiling a .dol August 24, 2010 02:14AM | Registered: 15 years ago Posts: 175 |
Re: Problems compiling a .dol August 28, 2010 08:02PM | Registered: 13 years ago Posts: 12 |
Re: Problems compiling a .dol August 29, 2010 07:36AM | Registered: 15 years ago Posts: 175 |
xpos Specifies the x-coordinate of the upper-left corner. ypos Specifies the y-coordinate of the upper-left corner. tex The texture to draw. degrees Angle of rotation. scaleX Specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally. scaleY Specifies the y-coordinate scale. -1 could be used for flipping the texture vertically. color Color in RGBA format.