fix crashbug 2d resize. add 2d tests. print offscreen warning better.