com.craftar
Class CraftARContentImageButton
- java.lang.Object
- com.craftar.CraftARContentBase
- com.craftar.CraftARContent
- com.craftar.CraftARContentImageButton
- com.craftar.CraftARContent
- com.craftar.CraftARContentBase
public class CraftARContentImageButton extends CraftARContent
An ImageButton content for aCraftARItemAR
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.craftar.CraftARContent
CraftARContent.ContentStatus, CraftARContent.ContentTouchEvent, CraftARContent.ContentWrapMode, CraftARContent.LoadContentInBackground
-
Nested classes/interfaces inherited from class com.craftar.CraftARContentBase
CraftARContentBase.ContentType, CraftARContentBase.ContentTypeName
-
-
Field Summary
Fields Modifier and Type Field and Description protected java.lang.String
mButtonPressedUri
protected java.lang.String
mButtonUri
-
Fields inherited from class com.craftar.CraftARContent
isAppInBg, mAlpha, mClickListener, mContentID, mHyperlinkUrl, mId, mNativeContentPtr, mRotationMatrix, mScale, mStatus, mTouchEventListener, mTranslation, mType, mUUID, mWrapMode
-
-
Constructor Summary
Constructors Constructor and Description CraftARContentImageButton(JSONObject contentJSON)
Create aCraftARContentImageButton
from a JSON that comes from the CraftAR service.CraftARContentImageButton(java.lang.String buttonUri, java.lang.String buttonPressedUri)
Create aCraftARContentImageButton
defining it's two images (pressed and non-pressed) programatically.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected void
contentLoadFinalized(boolean success)
The content resources finished loading.protected void
drawWithItemPose(float[] translation, float[] rotation, int drawMode)
Draws the content according to it's parent ARItem pose.protected void
finalize()
void
update()
Internal updateprotected void
updateContentAttributes()
Receives a notification that the content attributes (scale, pose, translation) have been modified.-
Methods inherited from class com.craftar.CraftARContent
cancelContentLoad, getAlpha, getContentType, getRotationMatrix, getScale, getStatus, getTranslation, getUUID, getWrapMode, onAppFinish, onAppPause, onAppResume, onDestroyedForOrientationChange, setAlpha, setContentClickListener, setContentTouchEventListener, setContentVersion, setRotationMatrix, setScale, setTranslation, setWrapMode
-
Methods inherited from class com.craftar.CraftARContentBase
clearContentResources, contentTypeFromJSON, trackingLost, trackingStarted
-
-
-
-
Field Detail
-
mButtonUri
protected java.lang.String mButtonUri
-
mButtonPressedUri
protected java.lang.String mButtonPressedUri
-
-
Constructor Detail
-
CraftARContentImageButton
public CraftARContentImageButton(java.lang.String buttonUri, java.lang.String buttonPressedUri)
Create aCraftARContentImageButton
defining it's two images (pressed and non-pressed) programatically.- Parameters:
buttonUri
- Image when the ImageButton is in it's normal state. The URI can be defined either as an URL http://example.com/image.jpg or a local URI.buttonUri
- Image when the ImageButton it's pressed. The URI can be defined either as an URL http://example.com/image.jpg or a local URI.
-
CraftARContentImageButton
public CraftARContentImageButton(JSONObject contentJSON) throws CraftARSDKException
Create aCraftARContentImageButton
from a JSON that comes from the CraftAR service. The button will have a default click listener, that will open a web browser if the field "hyperlink_url" is not empty- Parameters:
contentJSON
- describing this content- Throws:
CraftARSDKException
-
-
Method Detail
-
drawWithItemPose
protected void drawWithItemPose(float[] translation, float[] rotation, int drawMode)
Draws the content according to it's parent ARItem pose.- Specified by:
drawWithItemPose
in classCraftARContent
-
finalize
protected void finalize()
- Overrides:
finalize
in classCraftARContent
-
contentLoadFinalized
protected void contentLoadFinalized(boolean success)
The content resources finished loading.- Specified by:
contentLoadFinalized
in classCraftARContent
- Parameters:
success
- True if the content was loaded successfully, false otherwise.
-
updateContentAttributes
protected void updateContentAttributes()
Receives a notification that the content attributes (scale, pose, translation) have been modified. You can modify the attributes of anyCraftARContent
using the methods setTranslation , setRotationMatrix, and setScale.- Specified by:
updateContentAttributes
in classCraftARContent
-
update
public void update()
Description copied from class:CraftARContent
Internal update- Overrides:
update
in classCraftARContent
-
-