Skip to content

Commit

Permalink
refactor: removed deprecated loadCursorImage()
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmasB committed Mar 22, 2023
1 parent 4fa21a8 commit ec3f7dc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
Expand Up @@ -238,22 +238,6 @@ class FXGLAssetLoaderService : AssetLoaderService() {
return load(MUSIC, url)
}

// TODO: remove in future version
/**
* Loads cursor image with given name from /assets/ui/cursors/.
* Either returns a valid image or throws exception in case of errors.
*
* @param name image name without the /assets/ui/cursors/, e.g. "attack_cursor.png"
* @return cursor image
* @throws IllegalArgumentException if asset not found or loading error
*/
@Deprecated("Place cursor under textures/ and use loadImage() instead")
fun loadCursorImage(name: String): Image {
val url = getURL(CURSORS_DIR + name)

return load(IMAGE, url)
}

/**
* Loads resource bundle with given [name] from "/assets/properties/".
*
Expand Down
13 changes: 0 additions & 13 deletions fxgl/src/test/kotlin/com/almasb/fxgl/app/AssetLoaderServiceTest.kt
Expand Up @@ -274,19 +274,6 @@ class AssetLoaderServiceTest {
assertThat(map.getString("testKey"), `is`("testValue"))
}

@Test
fun loadCursorImage() {
var cursorImage = assetLoader.loadCursorImage("test_cursor.png")

assertThat(cursorImage, `is`(notNullValue()))
assertThat(cursorImage.width, `is`(64.0))
assertThat(cursorImage.height, `is`(64.0))

cursorImage = assetLoader.loadCursorImage("bla-bla")

assertThat(cursorImage, `is`(notNullValue()))
}

@Test
fun loadUI() {
var count = 0
Expand Down
Binary file not shown.

0 comments on commit ec3f7dc

Please sign in to comment.