TelKel81 Active Member Licensed User Longtime User Jan 15, 2020 #1 Hi, While drawing on the Scrollview2D InnerPanel's canvas, I exceed memory limit around 25x25 tiles (200-250mb bitmap). I don't think loadbitmapsample will help me here because the main culprit is obviously the huge canvas, not the bitmaps drawn on it (quickly nulled). What approach would allow me to go in the 50x50 or even 100x100 range ? No matter what the approach is, I would like to be able to keep using the NineOldAndroids module for animations (unless you suggest something even better). Basically I use time interpolators such as "INTERPOLATOR_ANTICIPATE_OVERSHOOT" to simulate movement/combat. I don't have time to draw sprites So if I draw "only according to the user's scrolling", it becomes hard to also adjust views and animations in real-time. Unless I'm wrong, I couldn't use X2 Framework (X2TileMap) because I use hex tiles ? Even if I could, I'm not sure I could easily use animated views while scrolling ?
Hi, While drawing on the Scrollview2D InnerPanel's canvas, I exceed memory limit around 25x25 tiles (200-250mb bitmap). I don't think loadbitmapsample will help me here because the main culprit is obviously the huge canvas, not the bitmaps drawn on it (quickly nulled). What approach would allow me to go in the 50x50 or even 100x100 range ? No matter what the approach is, I would like to be able to keep using the NineOldAndroids module for animations (unless you suggest something even better). Basically I use time interpolators such as "INTERPOLATOR_ANTICIPATE_OVERSHOOT" to simulate movement/combat. I don't have time to draw sprites So if I draw "only according to the user's scrolling", it becomes hard to also adjust views and animations in real-time. Unless I'm wrong, I couldn't use X2 Framework (X2TileMap) because I use hex tiles ? Even if I could, I'm not sure I could easily use animated views while scrolling ?
Erel B4X founder Staff member Licensed User Longtime User Jan 15, 2020 #2 Don't try to create a huge canvas with the complete world. You should instead draw the visible part only. This is done automatically by X2TileMap however you can also do it yourself. See angry birds example.
Don't try to create a huge canvas with the complete world. You should instead draw the visible part only. This is done automatically by X2TileMap however you can also do it yourself. See angry birds example.
TelKel81 Active Member Licensed User Longtime User Jan 18, 2020 #3 Thanks for the reply. Now I draw only the visible part but I can't figure out how I can animate views while scrolling the map because the left/top values of the views (on top of the visible part) also change while scrolling (therefore messing up the calculations of the animations). Any advice ? Thanks
Thanks for the reply. Now I draw only the visible part but I can't figure out how I can animate views while scrolling the map because the left/top values of the views (on top of the visible part) also change while scrolling (therefore messing up the calculations of the animations). Any advice ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 19, 2020 #4 Are you using XUI2D? There are several examples with moving background. You should work with the world coordinates.
Are you using XUI2D? There are several examples with moving background. You should work with the world coordinates.