Skip to content

Commit

Permalink
Minor fixes. Minor refactors.
Browse files Browse the repository at this point in the history
  • Loading branch information
payne911 committed Oct 10, 2019
1 parent 17ea4d8 commit 1631bbb
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 219 deletions.
11 changes: 7 additions & 4 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
[3.0.0]
- Refactored the Style so that most of the `float` values (`radius` and the likes) have become class-attributes instead.
- Many more constructors available. Basic `float` properties (`radius` and the likes) are now integrated in the constructors.
- `PieMenuSuggestedClickListener` renamed to `PieMenuClickListener` due to its now-default integration as a static inner class. A setter is provided to change this `ClickListener` to a custom one.
- Removed from the API the `@Deprecated` methods which should have been implemented by the users themselves anyway. This is reflected in the corresponding code-examples.
- `PieMenuSuggestedClickListener` renamed to `PieMenuClickListener` and is now added by default. A setter is provided to change this `ClickListener` to a custom one.
- Added callbacks for mouse-over. Added the corresponding `hoveredChildRegionColor` and `hoveredAndSelectedChildRegionColor` to the `PieMenuStyle`.
- Added `highlightedChildRegionColor` in the `PieMenuStyle`.
- The `PieMenuClickListener` now triggers a highlight on `touchDown` rather than waiting for the mouse to move after the initial click.
- The complementary callbacks (highlight and hover) are now regrouped within `PieMenuAdditionalChangeListener`.
- `HighlightChangeListener` renamed to `PieMenuHighlightChangeListener` and now extends EventListener. Removed the associated getter and setter: now `addListener()` should be used for that too.
- Widgets now start with their visibility set to `true` (it used to be `false`): this is to remain closer to scene2d's expected behavior.
- Changed the Actor-sizing algorithm (and thus fixed it for low `innerRadius` values).
- Integrated the propagation of the alpha from parent to children. Use the `setGlobalAlphaMultiplier(float)` method to do so.
- Fix for Widgets contained within a Table.
- Fix of the PieMenuStyle Colors-duplication.
- The `PieMenuSuggestedClickListener` now triggers a highlight on `touchDown` rather than waiting for the mouse to move after the initial click.
- HighlightChangeListener now extends EventListener. Removed the associated getter and setter: now `addListener()` should be used for that too.
- Style's `Circumference` values now include the `innerRadius` value.
- New API methods to allow more customization: `getActorDistanceFromCenter`, `getEstimatedRadiusAt` and `adjustActorSize` can be changed to be whatever you want.
- Removed from the API the `@Deprecated` methods which should have been implemented by the users themselves anyway. This is reflected in the corresponding code-examples.

[2.2.0]
- Animated versions of the implementations are now available!
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ allprojects {
ext {
...
pieMenuVersion = '2.2.0'
pieMenuVersion = '3.0.0-rc1'
}
repositories {
Expand Down Expand Up @@ -98,21 +98,26 @@ The basic idea looks like this:
```java
/* Setting up and creating the widget. */
PieMenu.PieMenuStyle style = new PieMenu.PieMenuStyle();
style.radius = 80; // you set up the way the widget looks by modifying the "style" variable
PieMenu menu = new PieMenu(shape, style); // "shape" is an instance of a ShapeDrawer
style.highlightedChildRegionColor = new Color(.7f,.3f,.5f,1); // "style" variables affect the way the widget looks
PieMenu menu = new PieMenu(shape, style, 80); // "shape" is an instance of a ShapeDrawer, "80" is the radius

/* Adding the listeners. */
menu.addListener(new PieMenuSuggestedClickListener());
/* Adding a listener. */
menu.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
System.out.println("The selected index is: " + menu.getSelectedIndex());
}
});

/* Populating the widget. */
for (int i = 0; i < 8; i++) {
Label label = new Label(Integer.toString(i), skin);
menu.addActor(label);
}


/* Including the Widget in the Stage. */
stage.addActor(menu);
menu.setVisible(true);
```

And *voilà*!
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply from: 'publish.gradle'
sourceCompatibility = 1.8

def projectName = 'pie-menu'
version '3.0.0'
version '3.0.0-rc1'
group 'com.payne.games'

def gdxVersion = '1.9.10'
Expand Down
Binary file modified media/custom_animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1631bbb

Please sign in to comment.