I look other tile-based game for learn and in Rogue Legacy I guess the AABB aren't in same size. And I want to know how to do this.
The game is mostly tile based with fixed AABBs. You can support a fixed set of different shapes of tiles, e.g. a square tile, a left-facing 45 degree slope, a right-facing slope, etc. Then instead of storing an entire AABB in each tile you need only store a little enum that defines the basic shape of the tile, with the specific collision values calculated based on the tile's position on its shape. See the classic
N+ collision tutorials.
You probably don't even want AABBs for your tiles, as this approach means you'll have "edges" between two adjacent tiles that your character may sometimes get snagged or stuck on. You will want a more specialized collision system for tiles that treats a floor as a single continuous flat surface rather than a bunch of separate boxes. There are many articles on this approach; I believe the N+ one above deals with it but it's been a while since I've read it.
The guide to implementing 2D platformers also covers this and the next topic.
Note of course that for sloped tiles or the like you're not using AABBs for the actual collision (you might use them for broadphase/midphase still).
For objects that aren't aligned to tiles, you need to support both tile collision detection and arbitrary AABB collision detection.
Player can walk on the library and walk on ground.
Does it multi-layer ? Or different AABB ?
The trick is relatively simple. For certain tiles (or objects, for non-tile-aligned set pieces) there are flags indicating that collision should be ignored based on the direction the player collides with the object. There are a few special rules you apply to objects marked with this flag:
1) If the player collides from the left or right or bottom, ignore the collision.
2) If the player is already overlapping the object then stop performing collision checks until they separate (this is an important but often overlooked detail to avoid some weird bugs when jumping while standing in front of such an object).
3) If the player collides form the top then stop the movement like a normal solid tile collision, unless the player is holding the "fall through" button (sometimes down or such; some games don't allow this at all).
These rules allow the player to jump on the tile/object but otherwise walk through it normally. You can do the same for sides of tiles to make one-way force fields or the like, too.