Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

top or bottom gap issue in the List component.. #38

Open
fkkcloud opened this issue Mar 14, 2016 · 8 comments
Open

top or bottom gap issue in the List component.. #38

fkkcloud opened this issue Mar 14, 2016 · 8 comments

Comments

@fkkcloud
Copy link

How would I control the gap ? (see the attached photo)

screen shot 2016-03-13 at 7 30 38 pm

@alaa-eddine
Copy link
Contributor

it depends on how you are implementing your layout.
can you share the layout configuration please ?

@fkkcloud
Copy link
Author

@alaa-eddine This is how I have it. (Also see the attached photo)
As you see I have phaser game screen above and have menus below.
But I think that does not matter to this issue but FYI.
What would be my good one to modify? Btw, awesome open source! Its helping me tons and tons :)

/* main screen ----------------------------------------------------------------------------------------------- */
var mainUIScreenJSON = {
    id: 'mainScreen',
    component: 'Window',    
    padding: 2,
    position: { x: 0, y: 240 },
    width: 400,
    height: 400,
    //layout: [null, null],
    children: []
};
/* footer Menu ----------------------------------------------------------------------------------------------- */
var footerMenuJSON = {
            id:'footerMenu',
            component: 'Layout',
            z: 1,
            padding: 1,
            position: { x: 0, y: 340 },
            width: 400,
            height: 60,
            layout: [6, 1],
            children: [],
        };
for (var i = 0; i < footerMenuDataJSON.length; i++){
    var menuName = footerMenuDataJSON[i];
    var button = {id: menuName.id, text: menuName.name, component: 'Button', position: 'center', width: 64, height: 40 };
    footerMenuJSON.children.push(button);
}
mainUIScreenJSON.children.push(footerMenuJSON);
/* list - quest ----------------------------------------------------------------------------------------------- */
for (var j = 0; j < listsJSON.length; j++){
    var listUI = {
            id:listsJSON[j].id,
            component: 'List',
            padding: 2,
            position: { x: 0, y: 0 },
            width: 400,
            height: 340,
            layout: [null, 5],
            children: []
        };
    for (var i = 0; i < listsJSON[j].data.length; i++){
        var itemData = listsJSON[j].data[i];
        var questName = { id: itemData.itemLabelId, text: itemData.itemName, component: 'Label', position: 'center', width: 100, height: 30 };
        var questLevel = { id: itemData.itemBtnId, text: 'Upgrade', component: 'Button', position: 'right', width: 100, height: 30 };
        var item = {
            component: 'Layout',
            padding: 2,
            position: { x: 0, y: 0 },
            width: 400,
            height: 68,
            layout: [2, null],
            children: [
                /* quest name */
                questName,
                /* quest level */
                questLevel,
            ]
        }
        listUI.children.push(item);
    }
    mainUIScreenJSON.children.push(listUI);
}

screen shot 2016-03-14 at 9 19 39 am

@alaa-eddine
Copy link
Contributor

I see now, I thought first that the gap you are having was always visible....

well the issue you have here is due to the way the scroller works, there is no option to do it cleanly, I'll check the code and see if I can add this as option or provide you with a hack.

your game seems really great ! if you want I can feature it on EZGUI official page, just ping me when it's released :)

@alaa-eddine
Copy link
Contributor

Just checked the code, try this.
after adding your listUI to the main screen.
try adding/substracting some value to listUI.container.height this is supposed to limit the scrollable area.

let me know if it helps

@fkkcloud
Copy link
Author

@alaa-eddine
It seems like listUI does not have property called 'container', where would I approach to this?

Thanks, I will definitely let you know when the game is ready :)

@fkkcloud
Copy link
Author

@alaa-eddine

EZGUI.components.listQuest.container.height += 10; // listQuest is the id of the UI.

It modifies component height but it stretches the images.
screen shot 2016-03-14 at 6 49 13 pm

@fkkcloud
Copy link
Author

@alaa-eddine I am still having the height gap issue. Let me know if there is any other suggestions.

As you see I have bottom UI as below attached image and each task has its loading bar. What would be great component to represent a loading bar? I am thinking of putting an image into "Layout" and animate it.

[the goal for my UI of each task in the list]
screen shot 2016-03-15 at 10 57 47 am

screen shot 2016-03-15 at 10 48 35 am

@fkkcloud
Copy link
Author

fkkcloud commented Apr 1, 2016

@alaa-eddine
Hey Alaa,

Could you feature this game that I made with EZ-GUI?

http://touchofblood.com/

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants