Skip to content

Commit

Permalink
Update some confusing and outdated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Dec 26, 2024
1 parent 9f18d7f commit f5301c5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/com/reco1l/andengine/Axes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum class Axes {


/**
* Whether this axis [Y] or [Both].
* Whether this axis is [Y] or [Both].
*/
val isVertical: Boolean
get() = this == Y || this == Both
Expand Down
16 changes: 8 additions & 8 deletions src/com/reco1l/andengine/ExtendedEntity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ abstract class ExtendedEntity(
*
* Example:
*
* If relativeSizeAxes is set to [Axes.Both] and we set the size to 0.5, the entity's
* If [relativeSizeAxes] is set to [Axes.Both] and we set the size to 0.5, the entity's
* size will be half the size of the parent.
*
* Note: autoSizeAxes has priority over relativeSizeAxes. As for example if autoSizeAxes
* is set to [Axes.Both] and relativeSizeAxes is set to [Axes.Both], relativeSizeAxes
* Note: [autoSizeAxes] has priority over [relativeSizeAxes]. For example, if [autoSizeAxes]
* is set to [Axes.Both] and [relativeSizeAxes] is set to [Axes.Both], [relativeSizeAxes]
* will be ignored.
*/
open var relativeSizeAxes = Axes.None
Expand Down Expand Up @@ -108,7 +108,7 @@ abstract class ExtendedEntity(
*
* Example:
*
* If relativePositionAxes is set to [Axes.Both] and we set the position to 0.5 for both axes,
* If [relativePositionAxes] is set to [Axes.Both] and we set the position to 0.5 for both axes,
* the entity's position will be at the center of the parent.
*/
open var relativePositionAxes = Axes.None
Expand Down Expand Up @@ -578,7 +578,7 @@ abstract class ExtendedEntity(

/**
* Sets a relative size for the entity.
* This will set the [relativeSizeAxes] property to [Axes.Both] automaticall.
* This will set the [relativeSizeAxes] property to [Axes.Both] automatically.
*/
fun setRelativeSize(width: Float, height: Float) {
relativeSizeAxes = Axes.Both
Expand All @@ -590,7 +590,7 @@ abstract class ExtendedEntity(
*
* Note: This will change the [autoSizeAxes] property to [Axes.None] automatically.
*
* @return Whether the size of the entity was changed or not, this depends on the [autoSizeAxes] property.
* @return Whether the size of the entity was changed or not.
*/
open fun setSize(newWidth: Float, newHeight: Float): Boolean {

Expand Down Expand Up @@ -692,6 +692,8 @@ abstract class ExtendedEntity(
|| drawY > pCamera.maxY || drawY + drawHeight < pCamera.minY
}

// Transformation

override fun getLocalToParentTransformation(): Transformation {

if (mLocalToParentTransformation == null) {
Expand Down Expand Up @@ -761,8 +763,6 @@ abstract class ExtendedEntity(
}


// Transformation

override fun setBlendFunction(pSourceBlendFunction: Int, pDestinationBlendFunction: Int) {
if (blendInfo != null) {
Log.w("ExtendedEntity", "BlendInfo is set, use blendInfo property to change the blending function.")
Expand Down
4 changes: 2 additions & 2 deletions src/com/reco1l/andengine/container/ConstraintContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ConstraintContainer : Container() {

var childX = child.x

// Relative positions will be multiplied by the remaining space since the
// Relative positions will be multiplied by the remaining space from the
// target's position to the edge of the container.
if (child.relativePositionAxes.isHorizontal) {
childX *= drawWidth - targetX
Expand All @@ -42,7 +42,7 @@ class ConstraintContainer : Container() {

var childY = child.y

// Relative positions will be multiplied by the remaining space since the
// Relative positions will be multiplied by the remaining space from the
// target's position to the edge of the container.
if (child.relativePositionAxes.isVertical) {
childY *= drawHeight - targetY
Expand Down
1 change: 0 additions & 1 deletion src/com/reco1l/andengine/container/ScrollableContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ open class ScrollableContainer : Container() {
ACTION_MOVE -> {
isDragging = true

// Coerce the delta values to the width and height of the container because the user can't scroll more than that.
var deltaX = localX - initialX
var deltaY = localY - initialY

Expand Down
4 changes: 2 additions & 2 deletions src/com/reco1l/andengine/text/TextSprite.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import kotlin.math.max
/**
* A sprite that displays text.
*
* Differently from the original [Text] class, this is a sprite that pre-renders the entire text
* to a texture, it is not as efficient as the original [Text] class, but it is more flexible and
* Unlike [org.anddev.andengine.entity.text.Text], this is a sprite that pre-renders the entire text to a texture.
* It is not as efficient as [org.anddev.andengine.entity.text.Text], but it is more flexible and
* allows for more customization.
*
* It is not recommended to use this on places where the text changes frequently, as it will
Expand Down

0 comments on commit f5301c5

Please sign in to comment.