float listCellWidth = listWidth;
float realListCellWidth = listCellWidth - bothBorders;
// float listCellHeight = preferredIconWidth - border;
float listCellHeight = preferredIconWidth ;
MTListCell cell = new MTListCell(realListCellWidth , listCellHeight, app);
cell.setNoFill(true);
cell.setNoStroke(true);
// /*
Vertex[] vertices = new Vertex[]{
new Vertex(realListCellWidth-topShift, border, 0, 0,0),
new Vertex(realListCellWidth-topShift, listCellHeight -border, 0, 1,0),
new Vertex(realListCellWidth-topShift - icon.height, listCellHeight -border, 0, 1,1),
new Vertex(realListCellWidth-topShift - icon.height, border, 0, 0,1),
new Vertex(realListCellWidth-topShift, border, 0, 0,0),
};
MTPolygon p = new MTPolygon(vertices, getMTApplication());
p.setTexture(icon);
// p.setNoStroke(true);
// p.setStrokeColor(new MTColor(150,150,150, 255));
p.setStrokeColor(new MTColor(80,80,80, 255));
Vertex[] verticesRef = new Vertex[]{
new Vertex(listCellWidth - icon.height - reflectionDistanceFromImage, border, 0, 0,0),
new Vertex(listCellWidth - icon.height - reflectionDistanceFromImage, listCellHeight -border, 0, 1,0),
new Vertex(listCellWidth - icon.height - reflection.height - reflectionDistanceFromImage, listCellHeight -border, 0, 1,1),
new Vertex(listCellWidth - icon.height - reflection.height - reflectionDistanceFromImage, border, 0, 0,1),
new Vertex(listCellWidth - icon.height - reflectionDistanceFromImage, border, 0, 0,0),
};
MTPolygon pRef = new MTPolygon(verticesRef, getMTApplication());
pRef.setTexture(reflection);
pRef.setNoStroke(true);
cell.addChild(p);
cell.addChild(pRef);
list.addListElement(cell);
addTapProcessor(cell, sceneToCreate);
// */
/*
MTRectangle rect = new MTRectangle(icon, getMTApplication());
rect.setUseDirectGL(true);
// rect.setNoStroke(true);
rect.rotateZ(rect.getCenterPointLocal(), 90, TransformSpace.LOCAL);
MTRectangle reflectionRect = new MTRectangle(0, height, width, height, getMTApplication());
reflectionRect.setTexture(reflection);
reflectionRect.setUseDirectGL(true);
// reflectionRect.setNoStroke(true);
reflectionRect.rotateZ(rect.getCenterPointLocal(), 90, TransformSpace.LOCAL);
cell.addChild(rect);
cell.addChild(reflectionRect);
list.addListElement(cell);
addTapProcessor(cell, sceneToCreate);
rect.setAnchor(PositionAnchor.UPPER_LEFT);
reflectionRect.setAnchor(PositionAnchor.UPPER_LEFT);
PositionAnchor oldCellAnchor = cell.getAnchor();
cell.setAnchor(PositionAnchor.UPPER_LEFT);
rect.setPositionRelativeToParent(cell.getPosition(TransformSpace.LOCAL));
rect.translate(new Vector3D(realListCellWidth - topShift, 0));
reflectionRect.setPositionRelativeToParent(cell.getPosition(TransformSpace.LOCAL));
reflectionRect.translate(new Vector3D(realListCellWidth - topShift - icon.height - gapBetweenIconAndReflection, 0));
cell.setAnchor(oldCellAnchor);
// rect.setPositionRelativeToParent(cell.getCenterPointLocal());
// MTRoundRectangle r = new MTRoundRectangle(0, 0, 0, listCellWidth, listCellHeight, 30, 30, getMTApplication());
// cell.addChild(r);
// getCanvas().addChild(rect);
*/
///Add scene title
MTTextArea text = new MTTextArea(app, font);
text.setFillColor(new MTColor(150,150,250,200));
text.setNoFill(true);
text.setNoStroke(true);
text.setText(sceneToCreate.getTitle());
text.rotateZ(text.getCenterPointLocal(), 90, TransformSpace.LOCAL);
cell.addChild(text);
// text.setAnchor(PositionAnchor.CENTER);
// PositionAnchor oldCellAnchor = cell.getAnchor();
// cell.setAnchor(PositionAnchor.CENTER);
// text.setPositionRelativeToParent(cell.getPosition(TransformSpace.LOCAL));
// text.translate(new Vector3D(realListCellWidth - topShift, 0));
// cell.setAnchor(oldCellAnchor);
text.setPositionRelativeToParent(cell.getCenterPointLocal());
text.translate(new Vector3D(realListCellWidth*0.5f - text.getHeightXY(TransformSpace.LOCAL)*0.5f, 0));
///
}