⠀ ⠀⠀ ⠀
⠀ ⠀
⠀
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Hutsalod:HutMovie:1.3.1'
}
⠀
Methods | Description |
---|---|
show(); | Animation of appearance |
hide(); | The attenuation animation |
Methods | Description |
---|---|
left(); | Move the object to the left |
right(); | Move the object to the right |
up(); | Move the object to the up |
dowm(); | Move the object to the down |
move(); | Move edges by X and Y |
position(); | Move the object to the X and Y |
rotation(); | objecct rotation |
collision(); | Collision of an object with an object |
jump(); | High jump |
follow(); | Movement to the object |
Methods | Description |
---|---|
isRoom(); | The object is not in the room |
repeat(); | Repeat the animation |
⠀
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/grass">
<ImageView android:id="@+id/Person1"
android:layout_width="50dp"
android:layout_height="50dp"
app:srcCompat="@drawable/sprite" />
<ImageView android:id="@+id/Person2"
android:layout_width="50dp"
android:layout_height="50dp"
app:srcCompat="@drawable/sprite2" />
</FrameLayout>
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
HutMovie person1 = new HutMovie(findViewById(R.id.Person1));
HutMovie person2 = new HutMovie(findViewById(R.id.Person2));
person1.right(200)
.down(200)
.repeat(true)
.onRun();
person2.move(200,300)
.repeat(true)
.onRun();
}
}
⠀
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/grass">
<ImageView android:id="@+id/Person1"
android:layout_width="50dp"
android:layout_height="50dp"
app:srcCompat="@drawable/sprite" />
<ImageView android:id="@+id/Person2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="right"
app:srcCompat="@drawable/sprite2" />
</FrameLayout>
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
HutMovie person1 = new HutMovie(findViewById(R.id.Person1));
HutMovie person2 = new HutMovie(findViewById(R.id.Person2));
person1.move(400,400).onRun();
person2.move(-400,400).collision(person1).onRun();
person2.setAction(new HutMovie.Collision() {
@Override
public void onActionCollision() {
Toast.makeText(getApplicationContext(), "WORKING!",Toast.LENGTH_LONG).show();}
})
}
}
⠀
Retrolambda needs java8 to be installed on your system
export ANDROID_HOME=/path/to/android/sdk
git clone https://github.com/Hutsalod/HutMovie
cd HutMovie
echo "sdk.dir="$ANDROID_HOME > local.properties
./gradlew assembleDebug
Please report via GitHub issue :)