[HELP] Homebrew Launcher Mod

Discussion in 'Wii U - Homebrew' started by victormr21, Nov 25, 2016.

  1. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    Hi!
    Im doing a HBL Mod, and I want to modify the background, I want to change the blue background with bubbles to an image.
    I saw MainWindow.h and .cpp, but only I changed background color (here is a photo http://imgur.com/a/PdlT4) I tried to add the photo to filelist.h and put it in MainWindow.h and .cpp but each time, cmd give me some errors. I edited this files like HBAS files, putting the same format but it failed too.
    Can someone help me please? @dimok
    Bye!
     
  2. pwsincd

    pwsincd Garage Flower

    Member
    GBAtemp Patron
    pwsincd is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    3,375
    1,750
    Dec 4, 2011
    Manchester UK
    You can change the theme without recompiling by placing the images in the resources sub-folder.
    sd/wiiu/apps/homebrew_launcher/resources/

    the filename can be found on github, in the /data/images/.
     
  3. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    Yeah, I know it, I compile it for make a "normal" version without extra folders, and make a channel with this
    But I want change the background, and there isn't any picture of this to change, I have to add my picture to the code, the background its a mix of the color blue in RGB and the bubbles, this arent in a image too.
    I saw that HBAS of @vgmoose add a background image (bg.png) and a splash screen (splash.png, when you start HBAS and you see touch to continue and the credits...) But I tried to use the same code only changing the image name and cmd gave me some errors
    Thanks for reply, bye!
     
  4. Benoit934

    Benoit934 Advanced Member

    Newcomer
    52
    25
    Oct 31, 2016
    France
    Just look where external resources are loaded and edit this code with static content.

    I know you can easily create a bitmap but be careful because the TV and the Gamepad do not have the save resolution, the best way of displaying an image is to calculate the frame size and upscale of downscale the given image, you can fit a screen by zooming or leaving a black space but if you are zooming be careful with the buffer size if you print more pixels than the buffer can accept you'r screwed
     
    victormr21 likes this.
  5. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    Thanks for the reply, but I didn't understand nothing, I think you spoke in chinese xD.
    If you want to help me, I am ready, if not I understand it and i will wait
    Bye and thanks!
     
  6. vgmoose

    vgmoose GBAtemp Regular

    Member
    229
    627
    Jan 31, 2016
    United States
    Could you share the specific error that you're encountering?

    As for the HBAS background, it works as follows;

    1. These two fields defined in the header (.h) file:
    https://github.com/vgmoose/hbas/blob/master/src/menu/MainWindow.h#L48-L49

    2. Initialize those two fields in the constructor in the class (.cpp) file:
    https://github.com/vgmoose/hbas/blob/master/src/menu/MainWindow.cpp#L37-L38
    (they can also be initialized outside of the constructor, which has different syntax)

    3. Append the now initialized field variables to the main window:
    https://github.com/vgmoose/hbas/blob/master/src/menu/MainWindow.cpp#L48

    At this point your image should now be shown.

    Um, I was going to say step 4 is removing it in the destructor, to prevent memory leaks, but it seems I didn't do that:
    https://github.com/vgmoose/hbas/blob/master/src/menu/MainWindow.cpp#L108
     
  7. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    Thanks you So much vgmoose!
    I Will try It then, if It works I Will close the thread
    I had many errors, sometimes that there were things not declared in the scope
    In a line similar to: int widh, height or something similar said something and then in the command put MainWindow::widht and more errors, I Will try your litle guide and if It doesnt work I Will post the error
    Thanks!!!!
     
  8. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    This the error, i don't know if i have to put MainWindow::, delete it...
    I think there is other line in the file very similar, i will search it and try to fix it, if not i will delete this line, its very difficult to get to work but i have to try it
    EDIT: I deleted one line and it worked fifty fifty, HBL loads it but smaller than the original, and the space that it isnt the photo is black (bgColorImage (0, 0, 0, 0) or similar, so i will try to resize the image because i cant put the line.
    Or i will try my second intention, use a font for some words and other font for other words
     

    Attached Files:

    Last edited by victormr21, Nov 26, 2016
  9. Benoit934

    Benoit934 Advanced Member

    Newcomer
    52
    25
    Oct 31, 2016
    France
    When you declare a variable in a scope you can't re declare it if you want to modify a value juste put the variable name like :

    void Main() //this is a scope
    {
    int i; //this is a declaration

    i = 0; // I give a value (integer) to i

    int i; //This throw an error
    }

    In your case the first declaration is on the line 33 and your error at line 123
     
    Last edited by Benoit934, Nov 26, 2016
  10. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    bah, the backgroound its smaller than TV and DRC, i tried a lot of times to put a specific size instead the original (the original size is DRC screen size but appeares smaller) and when i press HOME button to exit (im using sendelf) and when i load an app it freeze :yayu::hateit:
     
  11. Benoit934

    Benoit934 Advanced Member

    Newcomer
    52
    25
    Oct 31, 2016
    France
    In normal cases the memory is released when you exit an app but if you use malloc you should after free the memory space.

    For the scaling you can create two images (to avoid resizing and pixels) then send image one to display one and image two to display two.
     
  12. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    I solved the image problem, i was using a image with the DRC size, i changed it to TV size (1280x720) and its complete in the two screens
    And the exit problem i solved it fifty fifty, i use Padcon, when you launch it, it redirects you to Menu.
    Now i want to add other image, its a phrase in the lower left corner, im doing the same steps that for background, i will find how to set a unique font only for this, and how to put it in the screen (i think i will have to put coordinates....)
    Bye!
     
  13. Benoit934

    Benoit934 Advanced Member

    Newcomer
    52
    25
    Oct 31, 2016
    France
    Everything you need is already in the source code :

    pointerImgData = Resources::GetImageData(filename.c_str());
    pointerImg = new GuiImage(pointerImgData); //Define the object GuiImage with the content of pointerImgData

    pointerImg->setScale(1.5f); //Scalling
    pointerImg[wpadIdx]->setPosition(posX, posY); //positioning
    pointerImg[wpadIdx]->setAngle(controller->data.pointerAngle); //Rotation
    pointerImg->draw(video); //Draw

    setAlpha //color intensity
     
    Last edited by Benoit934, Nov 27, 2016
    victormr21 likes this.
  14. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    Nothing, i use other variable, k, because if i edit i (wii remote variable) and i put other image i will use this image as cursor (it was funny), so i created k with the same parameters except rotation and draw but nothing appeared, the image was in the center and in small
    So i edited the Homebrew Launcher vx.x by Dimok with "logo.png" but in the screen appeared logo.png literally not the image so...
    And now i can return to Menu and open any app, this 2 things freeze my Wii U
    Bye!
     
  15. Benoit934

    Benoit934 Advanced Member

    Newcomer
    52
    25
    Oct 31, 2016
    France
    I did told you to use the cursor variable :P but gave you the functions and theirs usage

    for your image did you set the position and the scale ? You may check GuiImage file to see how it work

    "Homebrew Launcher vx.x by Dimok" is a string of chars so the variable only have text, an image is a list of pixels with their colors, alpha etc... (with some compression and meta data)

    The thing that make you load the image is Resources::GetImageData(filename.c_str()); and GuiImage constructor argument is that image.
     
  16. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
  17. Benoit934

    Benoit934 Advanced Member

    Newcomer
    52
    25
    Oct 31, 2016
    France
    The first issue is that logoImg and logoImgdata is not defined, you are working on an array that do not exist,

    You try to create 4 times the same image, std:string file name is defined in two loops but I'm not a CPP expert so I can't tell you how manipulate string in CPP
    the array of GuiImage is defined is the .h file (like it should) "GuiImage *pointerImg[4];" * means pointer, a pointer is a redirection to another memory addr, in that case there is 4 adresses, so an array of 4 GuiImage.

    So to add an image you should do like :
    .h
    GuiImage myImage;
    GuiImageData myImageData;

    .c
    myImageData = Resources::...
    myImage = New GuiImage(myImageData) ...
     
    victormr21 likes this.
  18. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    So the .h for define the new image I have to do this:
    Code:
    GuiImage * backgroundImg2
    GuiImageData * background Img2Data
    
    GuiImage1 * logoImg
    GuiImage1Data * logoImgData
    An the .cpp:
    Code:
     logoImgData[K] = Resources::GetImageData("logo.png")
    logoImg[K] = new GuiImage(logoImgData[K])
    Bye!
     
    Last edited by victormr21, Nov 28, 2016
  19. Benoit934

    Benoit934 Advanced Member

    Newcomer
    52
    25
    Oct 31, 2016
    France
    (Type)GuiImage* backgroundImg2(variable name)

    The type is GuiImage not GuiImage1 and k ins that case should be an integer (the first is 0)
     
  20. victormr21
    OP

    victormr21 GBAtemp Advanced Fan

    Member
    554
    69
    Dec 29, 2015
    Finally i found a rudimentary way to set the logo position. i edited the background image and i put the logo on it, and use 2 imagen in one, only i have to edit the image until have it in the correct pixel...
    But if i want add other image that it isnt in the main menu i dont know how to put it yet. If you can @Benoit934 can you say how to do it (concretlyment)
    The image is logo.png, in the .h its defined like:
    Code:
    GuiImageData logoImgData
    GuiImage logoImg
    And the .cpp:
    Code:
    , logoImgData(Resources::GetImageData("logo.png"))
    , logoImg(logoImgData)
    ......
    append(&logoImg);
    Bye!