MapView in a Tab - G1 General

Hi,
I want to design a Application witch shows a Map with places of some Mangastories for the G1. For this I want to have two tabs. On the first tab a list of Manga witch can selected and on the other tab I want to show it in a Map. Ok, i read the tutorial for the TabWidget and for the MapView, but how can i put the MapView into the Tab? My problem is that the class extends form to different class! First I think that i have to create a second class witch include the mapview. After i done this, i want to implement it in the tab class, but i have no clue if i am right! Or how to implement in the xml file?
The second idea was, that i writ a interface! But i think this is also the wrong way!
So please help me!

Related

TMoUS HD2 WishList

These are my requests that I have which would actually "complete" my perfect HD2... if any members here would like to contribute some info as to how I may go about and fulfill them, then I would have much gratitude. Thanks
-Aside from the volume control that MysticGenious posted along with his taskbar, is there any other cab or registry change that will allow me to change my volume in increments of 1 as opposed to 3 bars each time? I am familiar with the paid app, but I do not want to go that route.. If mysticGenious created something that works when you use his taskbar, then I'm sure someone else has created something.
-Take the application "FootPrints" for example... Unless I have that activated on my tab screens, I am unable to create a shortcut so that I can save it on as a quicklink. This is the same with the HTC Calender App and any other tab application. If its not active in the Tab menu then the shortcuts doesn't exist. Is there a workaround? I would like to use Foot Prints, but I only want it as a quicklink, NOT as a Tab folder. I have already tried activating the tab and creating the shortcut to the quicklinks, but as soon as i removed it from the Tab Menus, it disappeared. There has got to be a way for this to happen. Cause I mean the program is there, but for some reason it only works if its active in Tabs.
-Transformers... I have tried reinstalling the Transformers cab but that didn't work. I just want to be able to click the Transformers shortcut and be able to select either 1 or 2 and then the movie instantly pops up. I have the movies saved on my sd card now, but because i moved them out of the SD card and onto my computer at one point in time, the link that connected them is no longer there. Basically I have all the components, I just need some guidance on how to make the shortcut link and work again... I'm assuming that i have to direct the file via registry editor "Total Commander" or something, I am just confused when it comes to that stuff on my HD2
and believe it or not, thats actually the only issues I have left with the phone, I'm sure that someone has a suggestion, or knows an answer... thanks a lot guys

app help

Hello,
I have a class called MyLocationListener where I have onLocationChanged, etc. to check for location updates. This is a separate class, and I have another class above that where I am doing some main calculations. I need to perform an action if the location is changed, but the code needs to be in the above class. This won't work because 1. onLocationChanged is void and 2. it takes in a loc parameter.
Is there a handy way to check if the location is changed in onLocationChanged that I can use in the above class? Please help!
p.s. If you did not really get what I said, can you please reply and I can rephrase it? I really need an answer for this question

[ help needed ]

Hello to everyone.
I am new comer in the world of Android App Development.
I am completely new in android app development.
I want someone to teach me some basics so that I can learn that and them implement my own imagination to build a desire app.
Firstly, I have installed the adt_bundel which include SDK and eclipse.
When I first started using android, I learned that it is open source that means we can easily free the source code of it.
when I started using apps and games I always thought to make an android app for me.
So for that reason I m posting this.
I want to create a very simple app in which there are 3 buttons and when click on that button the background should change.
Eg: There are 3 button red,blue,green. so if I press the red button the background should change to red color and vise versa.
So can anyone please help me in building my very 1st own Android App.
What about video tutorials on youtube? For me the tutorials from 'thenewboston' helped a lot
tschmid said:
What about video tutorials on youtube? For me the tutorials from 'thenewboston' helped a lot
Click to expand...
Click to collapse
I tried mate and I got many tutorials on google with code but I didnt got clear idea. Mostly the example they all use in the tutorial is making calculator in which there are 2 text input field and 1 button. by pressing that both number will add.
I don't want that.
I have created many app in VB.Net in my college. Infact created a mini notepad and mini calculator.
Actually I have created the app in vb.net in which if we press the desire button it will change color. So I thought why can't I make for the Android too.
It's easy
Set OnClickListener for ur buttons to listen for click events.
e.g For changing color to red
red.setOnClickListener(new View.OnClickListener({
// use the reference to ur background layout and set the color
urBackgroundLayout.setBackgroundColor(Color.Red);
}));
Do the same for the other two buttons.
I hope this was helpful!
P.S : braces in the code snippet might b incorrect.
red.setOnClickListener(new View.OnClickListener{
public void onClick(View v) {
urBackgroundLayout.setBackgroundColor(Color.Red);
}
});
Yeah the braces are indeed not quite correct. Also i think you must put the onClick method inside the listener.
OkieKokie said:
Set OnClickListener for ur buttons to listen for click events.
e.g For changing color to red
red.setOnClickListener(new View.OnClickListener({
// use the reference to ur background layout and set the color
urBackgroundLayout.setBackgroundColor(Color.Red);
}));
Do the same for the other two buttons.
I hope this was helpful!
P.S : braces in the code snippet might b incorrect.
Click to expand...
Click to collapse
Thanks bro for replying.
Actually I a complete noob here.
I have created a graphical layout of my app with 3 bottons red blue and green.
Now the noob question is where I have to do the coding.
I have seen in many tutorial that the coding is done under src->package->.java file.
please correct me if I am wrong....
Masrepus said:
red.setOnClickListener(new View.OnClickListener{
public void onClick(View v) {
urBackgroundLayout.setBackgroundColor(Color.Red);
}
});
Yeah the braces are indeed not quite correct. Also i think you must put the onClick method inside the listener.
Click to expand...
Click to collapse
The same question goes to you bro.
Can you please explain in detail
what are the things I need to do.
Thanks
Mustakim_456 said:
The same question goes to you bro.
Can you please explain in detail
what are the things I need to do.
Thanks
Click to expand...
Click to collapse
Start a new Android app project in eclipse and it will generate a MainActivity.java file for you, do the coding there.
Also u will need to add views to ur graphical layout. After creating a new project go to the 'res' folder, then go to 'layouts' and open ur activity_main.xml. Add views to this file by dragging from the left pane onto the view.
Inside the MainActivity.java you will find a method called onCreate()
Inside it you put the code we gave you. This method is called when the app is started up, so all the initialising etc like setting button onClickListeners you have to do, is normally being put inside this onCreate()
You will also have to create a layout.xml for your app in which you put your buttons and one background layout, for example a linear layout, which will later change its colour.
All about how to make such a layout can be found in every video tutorial series you will find. I could recommend the mybringback youtube channel.
Now inside the code you got for the button, the button is being referred to as 'red' (see red.setOnClickListener(...) )
So now to be able to do that, before that you will have to declare that specific button:
Button red = (Button) findViewById(R.id.yourButtonId);
Click to expand...
Click to collapse
Same thing goes for the background layout, i will give you the example for a LinearLayout:
LinearLayout urBackgroundLayout = (LinearLayout) findViewById(R.id.yourLayoutId);
Click to expand...
Click to collapse
I called it urBackgroundLayout because in the code posted above it is being referred to as this. You can change it to whatever name you desire.
Now android knows which button the button 'red' actually is, when you replace the 'yourButtonId' with the id of that specific button. (Read about view ids in android on google or inside a tutorial video)
Same thing for the linear layout
Now after declaring all of your buttons that way, maybe Button green and Button blue,... You just copy/paste the code above for each button you have, e.g. 'blue.setOnClickListener' and 'green.setOnClickListener' and change the 'Color.Red' to each desired color, voila you are done!
Masrepus said:
Inside the MainActivity.java you will find a method called onCreate()
Inside it you put the code we gave you. This method is called when the app is started up, so all the initialising etc like setting button onClickListeners you have to do, is normally being put inside this onCreate()
You will also have to create a layout.xml for your app in which you put your buttons and one background layout, for example a linear layout, which will later change its colour.
All about how to make such a layout can be found in every video tutorial series you will find. I could recommend the mybringback youtube channel.
Now inside the code you got for the button, the button is being referred to as 'red' (see red.setOnClickListener(...) )
So now to be able to do that, before that you will have to declare that specific button:
Same thing goes for the background layout, i will give you the example for a LinearLayout:
I called it urBackgroundLayout because in the code posted above it is being referred to as this. You can change it to whatever name you desire.
Now android knows which button the button 'red' actually is, when you replace the 'yourButtonId' with the id of that specific button. (Read about view ids in android on google or inside a tutorial video)
Same thing for the linear layout
Now after declaring all of your buttons that way, maybe Button green and Button blue,... You just copy/paste the code above for each button you have, e.g. 'blue.setOnClickListener' and 'green.setOnClickListener' and change the 'Color.Red' to each desired color, voila you are done!
Click to expand...
Click to collapse
Thank you soo much... Learned a lot..
Mate I will tell you what I have done in detail ok. you correct me if I a doing something wrong.
1. Opened eclipse and selected new -> android project -> and created my app.
2. By default there is hello world text. so I deleted the text.
3. By default there is a layout i.e relative layout
4. So I dragged linear layout from the layout section. but got an warning message of something like there there is no id, no style etc. So I selected style from property windows and the warning message got dissappear
5. Then I inserted a large text. pressed F2 to change text of it. created a new string -> inserted name as My First App
6. After that I dragged 3 buttons. Again pressed F2 to change text and id off all the button by creating new string -> name as Red, Blue and Green and ID as button1, button2 and button3.
7. After that my app graphical layout is finished.
8. After that as you said I have to write code in MainActivity.java file. So in src folder and my package I opened up MainActivity.java file. By default there were 2 onCreate() Functions. When I try to write any code inside the onCreate() it gives me an error.
Please correct me.
If you provide me with a zip of the whole project folder, i would have a look at it if you would like
Mustakim_456 said:
Hello to everyone.
I am new comer in the world of Android App Development.
I am completely new in android app development.
I want someone to teach me some basics so that I can learn that and them implement my own imagination to build a desire app.
Firstly, I have installed the adt_bundel which include SDK and eclipse.
When I first started using android, I learned that it is open source that means we can easily free the source code of it.
when I started using apps and games I always thought to make an android app for me.
So for that reason I m posting this.
I want to create a very simple app in which there are 3 buttons and when click on that button the background should change.
Eg: There are 3 button red,blue,green. so if I press the red button the background should change to red color and vise versa.
So can anyone please help me in building my very 1st own Android App.
Click to expand...
Click to collapse
1)The first question is whether you know how to use the Java programming language fluently. That's a prerequisite.
2)If that's a yes then do you understand how the Android activity and fragment life cycle works and looks like? Probably not. Android is a lot about java APIs.
3)Goto https://developer.android.com and start learning Android APIs!
Maybe I'll write a startup guide to Android app programming. Give this a plus one if you'd like that! :thumbup:
Sent from my Nexus 4 using XDA Premium 4 mobile app
Masrepus said:
If you provide me with a zip of the whole project folder, i would have a look at it if you would like
Click to expand...
Click to collapse
sure I will provide you when I go back home. now I am in college.
boggartfly said:
1)The first question is whether you know how to use the Java programming language fluently. That's a prerequisite.
2)If that's a yes then do you understand how the Android activity and fragment life cycle works and looks like? Probably not. Android is a lot about java APIs.
3)Goto https://developer.android.com and start learning Android APIs!
Maybe I'll write a startup guide to Android app programming. Give this a plus one if you'd like that! :thumbup:
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
+1
bro I don't know any thing much in programming.
I have just learned very basic java programming in my college as tere was a subject. what I learned in my college and what I see in tutorials of android is completely different. so in short I am completely new to android and its java programming.
if you don't mind could you make a step by step guide of android app development as my app as an example. it would be very useful too.
Yeah the thing with android and java that you learn in school is this: if you learn java, you got i would call it the ability to use the basic operations you later definitely need for programming android, as android is obviously a java api. But in many cases android has different ways of approachal, one of the biggest being the activity system.
So learning java is important, but you have to know that some of the stuff you learn there you wont ever use with android.
Masrepus said:
Yeah the thing with android and java that you learn in school is this: if you learn java, you got i would call it the ability to use the basic operations you later definitely need for programming android, as android is obviously a java api. But in many cases android has different ways of approachal, one of the biggest being the activity system.
So learning java is important, but you have to know that some of the stuff you learn there you wont ever use with android.
Click to expand...
Click to collapse
I think thats the thing. Because there is no such thing which I learned in college goes for android programming. I learned different types of constructor and inheritance etc .
but in android its totally different.
Mustakim_456 said:
I think thats the thing. Because there is no such thing which I learned in college goes for android programming. I learned different types of constructor and inheritance etc .
but in android its totally different.
Click to expand...
Click to collapse
Yes constructor is such an example, because with android you only use it if you got a more complex project with more classes that are no activities. In any other case you put initialising things in onCreate() that you would normally put in the constructor
Same thing with inheritance, it is only needed if you use more complex projects. But you should anyways at least know what it is and how it works
Masrepus said:
Yes constructor is such an example, because with android you only use it if you got a more complex project with more classes that are no activities. In any other case you put initialising things in onCreate() that you would normally put in the constructor
Same thing with inheritance, it is only needed if you use more complex projects. But you should anyways at least know what it is and how it works
Click to expand...
Click to collapse
yeah bro I know how to do inheritance and initialize construtor but here its of no use na...
Here is the zip of my project.
No coding is done. its only graphical layout of my app.

[Q] Advice regarding optimizing app performance since it consists of lots of views.

Hey guys, I'm an amateur at android development and this is my first app. I'm trying to make an app which you could basically think of like a book. It will consist of verses from a certain scripture one verse per screen, the screen will have the verse in it's original language "sanskrit", and these three things: 1 it's meaning in english, 2. it's meaning in hindi, and 3. the word meaning of each of the sanskrit words in hindi and english. I want these three things inside a tabhost.
Now the scripture has like 500 verses divided into 18 chapters. Each verse is like 10 words long. So there will be like 500 different views (if that's the right word for it... what I mean is 500 "screens" if that makes any sense) What I've done till now is, I made a sliding drawer that would take you to one of the 18 chapters. Now choosing one of the chapters will take you to a fragment, in which there will be a viewflipper, and it will consist of the verses in that chapter and a title page for that chapter which will consist of links to each of the verses. (I've done everything upto here there's just one sample chapter and 2 sample verses and it works fine) Also in the actionbar there will be a dropdown menu kind of thing clicking on which will give a list of verse numbers, and you can navigate to any verse from there. (I haven't done that yet)
So the thing is, 500 verses, 500 "views" (if i'm using that correctly) I don't know if that will make the device slow or what. I wanted to know am I using the right tools for it? Like the sliding drawer, fragment, tabhost, viewflipper? And the way I've structured the app, what do you feel about that? Will doing it differently could make it faster? I haven't had any problem yet with 1 chapter and 2 verses, I'm going to try adding a bunch of sample chapter and verses and see how it affects the performance. Still I just wanted to know ahead of time if I'm making any huge mistake in using one of the tools that I'm using.
I'd really really really appreciate if someone would take his/her time and give some valuable advice. Thanks in advance.
EDIT: So initially I was planning to have minSdkVersion = "11" and targetSdkVersion = "21", but if that would be impossible due to the large number of verses, I might reconsider that. And I'm using Eclipse to code, and AVD (Android Virtual device) manager to test the app.
EDIT: Also, using maybe sqlite to get the verses (I've just heard a bit about it never used it), would that help?
I'm just replying because I would like to know the same thing...
It shouldn't make your app slow if you're managing View's lifecycle properly. Basically you need to make sure that you're reusing views instead of creating new ones, same thing for Fragments (take a look at android.support.v4.app.FragmentStatePagerAdapter).
surlac said:
It shouldn't make your app slow if you're managing View's lifecycle properly. Basically you need to make sure that you're reusing views instead of creating new ones, same thing for Fragments (take a look at android.support.v4.app.FragmentStatePagerAdapter).
Click to expand...
Click to collapse
Okay so you mean when one navigates to a view it should not create a new view but it should reuse the existing ones? I actually made the sliding drawer (which navigates to the chapters) from a tutorial titled "android sliding menu using navigation drawer" (can't post links since me a newbie here ), I hope they managed View's lifecycle properly. And I'm using ViewFlipper to navigate between verses in individual chapters. So I hope that would be okay.
And I haven't used Sqlite but I vaguely know what it does. Will using that to extract the verses from a database then displaying them be of any help? Would it make the app any faster?
Thanks a lot for your help man, really appreciate it. :good::good:
kumar935 said:
So I hope that would be okay.
Click to expand...
Click to collapse
Just give it a try, man. You will never know till you have it tried. Implement, test, improve. Don't be a victim of premature optimization . Good luck!

[Library] BobEngine - Easy to use 2D game engine for Android

Hello, XDA!
I have created my own 2D game engine that utilizes OpenGL and sports many features to help make programming 2D games for Android as quick and simple as possible. I created this engine for use in my own projects but then I thought why no make it open-source? I think other people could benefit from this and input from other developers could help fine tune this thing so it's as good as it can be.
So I gave my engine the name "BobEngine" after my online alias and uploaded the first public release called "BobEngine 1.0 Thingama" to GitHub. That was months ago and now I've finished working on the next update: BobEngine 2.0 Shishka.
I've got a post on my website detailing what's new in update: http://www.bobbyloujo.com/2015/01/bobengine-20-shishka-update.html
BobEngine uses a similar structure to GameMaker games so if you've ever used that you may be interested in BobEngine. BobEngine uses a specialized BobView to display the content of Rooms. Rooms are collections of GameObjects which each have a graphic and attributes such as x and y positions, width, height, angle, frame, etc... Rooms and GameObjects also have step, newpress, and released events built in. The step event happens each frame, the newpress event happens when a new pointer is touched on the screen, and the released event happens when a pointer is lifted from the screen.
There are many other tools included with BobEngine and the best way to start learning how to use them is have a look at the examples that are included! In the GitHub repository you'll find an Android Studio project called "BobEngine". This project contains the "bobEngine" library module that you'll need to include in your own projects if you want to use BobEngine. Also in the BobEngine project are modules for each of the included examples. Currently there are examples that demonstrate the structure of a BobEngine game, how to use input from the touch screen, and how to manipulate the camera. I'll be creating more examples in the future to show off all the things you can do with this engine!
All the methods and data members in BobEngine are internally documented and the examples include a lot of internal documentation to help you out as well.
I'll keep updating the library with new things as I think of them. If there is anything you think should be added go ahead and post about it in this thread.
Benjamin Blaszczak
a.k.a. Bobby Lou Jo
@Bobbyloujo on Twitter
Edit: Forgot the GitHub link: https://github.com/Bobbyloujo/BobEngine
@Bobbyloujo
Thanks man will try this today and welcome 2 xda :highfive:
Thanks sir...pls give us some game template made from your lib
Great job man. It looks great.
I will try as soon as possible
Sylvain
Thanks man. Will surely try it out. good work.
Awesome, just what I've been looking for. Thanks!
nice work, and thanks for putting your time and effort into it.
Could this be used to recreate "biomenace" for android?
Thanks everyone!
@berlyshells Anything you want to see in particular? I could probably throw together a Flappy Bird clone real quick or something...
@verbuyst It certainly looks doable if you put the time and effort into it.
Bobbyloujo said:
..
Click to expand...
Click to collapse
im not really looking for anything in particular..probably any game source with comments (of the functions/what for is this code etc..) inside the code would be nice haha i just requesting but its you're choice sir im sorry im just a newbie
TIA
A new example has been added to the repository per @berlyshells request. This example is called Jumpy Bug and it is a Flappy Bird clone. It demonstrates what a full game programmed with BobEngine looks like.
Bobbyloujo said:
....
Click to expand...
Click to collapse
thank you very much sir..you are indeed a good hearted person..this is what i really love on xda
While working on my most recent project I made a few changes to BobEngine. The changes have been uploaded to GitHub.
Changes:
The extra functionality provided by BobActivity has been moved to a new class - BobHelper. A BobHelper can be used by any activity. When using a BobHelper, be sure to call its onResume() method from your activity's onResume() method. BobActivity still functions the same way it did before. BobHelper is useful for when you want to use some other kind of activity has your application's main activity but still want the extra functions from BobActivity. For example, if you want to use BaseGameActivity from the BaseGameUtils library for Google Play services.
SplashActivity has been totally changed because, frankly, it sucked before It is now an abstract class. Create your own activity for showing splash screens and extend SplashActivity. Implement the setup() and end() methods. In the setup() method, call addSplash(R.layout.your_splash_layout, time_in_ms) to add a splash screen to show as defined by an xml layout. You can add up to 10 layouts. Add them in the order you want them to show. The end() method is called after the last splash screen has been shown. In the end() method, start an intent for your main activity and then call finish() to close the splash screen activity.
Other small changes.
How many games have made using library? Looks cool)
Thanks..I tried AndEngine and it failed to import on my Android Studio.
Marshal3 said:
How many games have made using library? Looks cool)
Click to expand...
Click to collapse
Uhm... about three. There's Plane Popper, Crazy Taxi Driver, and I just finished Bounce the Beach Ball. Other than that, I've made a few examples that you can find in the repository - including a Flappy Bird clone. Also, I've been working on a platformer.
basil2style said:
Thanks..I tried AndEngine and it failed to import on my Android Studio.
Click to expand...
Click to collapse
Let me know if you need any help with BobEngine!
Hello again, XDA!
I've updated BobEngine again. This update brings the following major additions:
Gamepad support! You can now get input from any standard gamepad using BobEngine. A new example has been added to the Android Studio project that shows and explains how to use this new gamepad support. The example is called controllerexample.
Multiple quads per GameObject. Up until now, a GameObject consisted of a single textured quad (well, two triangles that form a quad). Sometimes it is useful to have many quads grouped together. If you use this, note that all the quads for each GameObject must have the same graphic. This is a very niche feature that I added for a particular purpose but didn't end up using myself. If you'd like an example of what can be done with this, let me know and I'll make one.
Some other miscellaneous stuff has been changed as well. It's been so long since I posted an update that I forget everything I changed! One useful change I made was to the camera features. Rooms now have their own camera values, meaning if you change the camera in one room, then switch to another and change the camera there, then switch back to the first room the camera will be where you left it in the first room.
BobEngine can of course still be found here on GitHub: https://github.com/Bobbyloujo/BobEngine
Here's a video showing off gamepad support: https://youtu.be/vRdaaaJnqGk
As always, if you have any questions feel free to ask. Also, if you've made anything with BobEngine I would love to see it! Whether it's something big or something small I'd love to see how others have used my engine
If you haven't already, please follow me on Twitter. My handle is @Bobbyloujo and I post updates about the games and things I'm working on there pretty frequently. Right now I'm working on something pretty big!
Another new update today!
Changes:
* TextDisplay object added! TextDisplay is a GameObject that can be used to output text! Text can be centered, aligned left or right. A new example has been added to show how this new object can be used.
* A new 'visible' attribute has been added to GameObjects. Setting gameObject.visible to false will cause the object to be hidden so it isn't drawn.
* The getAngle() function in Room.java was broken. It has been fixed so now getAngle() and getAngleBetween() both work properly.
* The getRatioX() and getRatioY() functions sometimes would not work properly on some devices. This has been fixed.
* When using multiple quads per GameObject, the performance has been increased. This was done by collecting vertex data from the quads in a way that does not require the concatenation of many arrays.
As always, the repository can be found here: https://github.com/Bobbyloujo/BobEngine
It'll really help me out if you follow me on Twitter: https://twitter.com/Bobbyloujo
And like my Facebook page: https://www.facebook.com/BobbyLouJo
If you have any questions or would like to report a bug, please leave a message in this thread or PM me on XDA, Twitter, or Facebook.
Have a great week!!
Version 3.0 Bobsled
It's been a while, but in the time since my last update I've added a lot of new things to BobEngine. Since it's such a big update, I'm giving it a new version name: v3.0 Bobsled. Here goes:
RoomCache - In BobView.java you will find a new static class called RoomCache. As the name implies, RoomCache is used for storing and retrieving instances of Rooms. The nice thing about RoomCache is that you can call getRoom(Class roomType) with any class type that inherits Room and the function will return an instance of that room type, even if you haven't manually added a Room of that type to the cache. The function getRoom(...) will search the cache for an instance of roomType and return it if one is found OR it will create a new instance of roomType using reflection and return that. You'll also notice that there is a getRoom(Class roomType, Object... args) function. If you have created a room type that takes parameters other than (BobView view) like a default Room does, you can use this method to pass the required arguments to initialize a new instance of that room type if need be. The cache holds a specified max number of Rooms. When the cache is full and a new Room is added, the oldest Room is removed. You can make your own RoomCaches, but each BobView has it's own cache with an initial size of 3. To access it from your BobView, just call getRoomCache().
Along with RoomCache, BobView has received two new goToRoom overrides: goToRoom(Class roomType) and goToRoom(Class roomType, Object... args) for switching to rooms retrieved from the RoomCache.
Input events (newpress, released) are now handled on the main thread (same thread as step event). Handling game logic on the separate input thread was causing a lot strange glitches in my games when values were being changed when I was not expecting them to be changed. Now, input will be handled on the same thread just before the step event.
For even more convenience and even quicker game development, a new constructor has been added to GameObject: GameObject(Room room). This will automatically assign an instance ID number AND add the object to the room. What typically looked like this before:
Code:
GameObject object = new GameObject(room.nextInstance(), room);
room.addObject(object);
Now looks like this:
Code:
GameObject object = new GameObject(room);
So simple! The old constructor is still there and behaves the same way for those who want it and for backwards compatibility.
Setting GameObject.visible to false will now hide all Quads belonging to that GameObject. This will not change the Quad.visible field for any Quad. Also, similarly to GameObject, Quads are now added to the GameObject when initialized.
Animations can now be played once and looped for a limited number of times. animationFinished() will return true when an animation has finished playing.
Animation class - a new class has been added to GameObject.java. This class can be used to predefine animations with a start frame, end frame, fps, and loop times.
Previously, I was using 3 coordinates for each vertex. I learned it's possible to use only 2 in OpenGL. Since the 3rd vertex is not needed, I changed the code to use only 2 vertices. I'm not sure if this actually caused any performance improvement.
Graphic.Parameters class - A new class in Graphic.java allows you to predefine Graphic parameters to use with GameObject.setGraphic(Graphic.Parameters params). Useful for when you want to switch between graphics on a GameObject often.
A new method in the Graphic class called setDimensions(int width, int height) allows you to set the height and width of the DPI level image you want to use for setGraphic(Graphic g, int x, int y...). Previously, you would have to use setPreciseGraphic(...) if you had different sized images for different DPI levels that have multiple graphics on them.
Set the color intensity of all GameObjects on a specific layer using Room.setLayerColor(int layer, float r, float g, float b, float a).
Graphics management (this is a big one):
The Room, Graphic, and GraphicsHelper classes have been updated to improve and simplify management of graphics for large games. A new GraphicsHelper.cleanUp() method makes it easy to manage graphics. You can choose points in your game to call cleanUp(). When called, Graphics that have not been used recently will be unloaded and removed from the GraphicsHelper. Graphics have a new public field called 'persistent' which when set to true will cause the graphic to remain loaded when cleanUp() is called. All non-persistent Graphics will survive through a set number of cleanUp() calls before they are removed. If a Graphic is removed but then a GameObject tries to use it again, it will automatically be re-added to the GraphicsHelper and reloaded.
You can also manually call:
Graphic.load() to load a graphic after is has been added to the GraphicsHelper.
Graphic.unload() to unload a graphic
Graphic.remove() OR GraphicsHelper.removeGraphic(Graphic g) to unload and remove a Graphic from the GraphicsHelper.
OKAY, I think that's just about everything. I actually had to look through the changes in the GitHub commit to remember all the things I've changed xD There are a few other small changes but I didn't think they were important enough to list. Now I want to ask you guys something:
Is there any interest in a full-blown tutorial series for BobEngine?
I could start with the basics, then explain more advanced features like graphics management. I could also take requests for certain tutorials. I could even cover general game development topics and how to implement them with BobEngine. Doing this would be a lot of work so before I dive in I really want to gauge the level of interest in BobEngine. So far, it's been difficult to tell how many people are interested because I haven't gotten an overwhelming amount of replies here but every once in a while I get a PM or email asking for help. So if you're using BobEngine raise your hand!
And of course: if you've made anything with BobEngine I would love to see it! I've seen a few things and it makes me happy to see you guys using getting some use out of my engine.
Thanks for your time! If you have any questions, just ask. You find any issues with BobEngine, post them here or on GitHub and will fix them. Also don't forget to let me know if you're using BobEngine!
Once again, the repo can be found here: https://github.com/Bobbyloujo/BobEngine
Thanks again,
Ben a.k.a. Bobby Lou Jo
Twitter: https://twitter.com/Bobbyloujo
Facebook: https://www.facebook.com/BobbyLouJo
you are great and i should more from you
I am a new man in the electronic area, and you have developed your own staff, you set a good example for me.
Jackiefire said:
I am a new man in the electronic area, and you have developed your own staff, you set a good example for me.
Click to expand...
Click to collapse
Thanks! Your support means a lot.

Categories

Resources