java - how to set a specific position of image in hidden object game -
i developing hidden object game android in eclipse. have settle background , want put small images on background on specific positions using x , y axis. how it. have searched lot haven't found helping. giving code. , yes have used java prams imagebutton method , set(x) , (y) method well(which available in honeycomb 3.0).
here xml code:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/bg_level1" > <imagebutton android:id="@+id/ibcross" android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/cross" /> </linearlayout>
stage.java
package com.findmystuff; import android.app.activity; import android.os.bundle; import android.widget.absolutelayout; import android.widget.imagebutton; import android.widget.linearlayout; import android.widget.textview; public class stage extends activity{ imagebutton ib1;; string st = "what fuck this!"; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.level1); ib1=(imagebutton) findviewbyid(r.id.ibcross); ib1.setx(445); ib1.sety(767); } }
it giving me error of "call requires api level 11 (current min 10): android.widget.imagebutton#setx" , of course want float numbers. if set min api 11. float notation of x , y axis.
is there alternative function. takes arguments of x , y axis , put image on specified position on background? or else. simple , not tedious have put several images on different levels of game.!!
thanks in advance suggestions.
Comments
Post a Comment