Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Here the base layout I use :
- auto Wallpaper_List_Layout = Layout("background_ori_layout", scene, cocos2d::ui::Layout::Type::ABSOLUTE,10000);
- Wallpaper_List_Layout.setPosition({Ori_Pos_X, Ori_Pos_Y});
- Wallpaper_List_Layout.setContentSize(grid_size_ori);
- // Wallpaper_List_Layout.setBackgroundColor(cocos2d::Color3B::RED, 60);
- Wallpaper_List_Layout.setAnchorPoint(cocos2d::Vec2::ANCHOR_MIDDLE);
- // here the grid view generation
- GridView Wallpaper_List_lrs("background_lr", Wallpaper_List_Layout, 1); //Will hold lrs wallpapers list
- Wallpaper_List_lrs.setBackgroundColor(cocos2d::Color3B::BLUE, 60);
- Wallpaper_List_lrs.setContentSize(grid_size_ori);
- Wallpaper_List_lrs.setCellPadding(Ori_padding_W,Ori_padding_H);
- Wallpaper_List_lrs.setCellSize(cell_size_ori);
- Here how I add it (with a loop)
- Button Wallpaper_btn_lrs(curr_id_str_btn, Wallpaper_List_lrs, 2);
- std::string Path_thumbs = layout_image_thumb_path + "cha_base_0" + std::to_string(element_id_int_LD) + "_05.png";
- Wallpaper_btn_lrs.setDefaultImage(Path_thumbs);
- Wallpaper_btn_lrs.setPressedImage(Path_thumbs);
- Wallpaper_btn_lrs.setScale(Icons_scale,Icons_scale);
- Wallpaper_btn_lrs.setDisabledImage(Path_thumbs);
- Wallpaper_btn_lrs.addClickEventListener([=](void *) mutable {
- Wallpaper_List_lrs.setVisible(false);
- PreviewWallpaper(Card_bg_effect_id_int, scene, Wallpaper_List_lrs);
- });
- ImageView Wallpaper_btn_image(curr_id_str_icon, Wallpaper_btn_lrs, 55);
- Wallpaper_btn_image.setScale(Icons_scale,Icons_scale);
- Wallpaper_btn_image.loadImage(Icon_Path);
- Wallpaper_btn_image.setAnchorPoint(cocos2d::Vec2::ANCHOR_MIDDLE);
- Wallpaper_List_lrs.addCustomItem(Wallpaper_btn_lrs);
Advertisement
Add Comment
Please, Sign In to add comment