protected override void update_movement(bool input) { int index = this.index; if (num_items() > 0) { (Items as PartialRangeVisibleUINodeSet <CommandUINode>) .Update( input && !Movement_Locked, visible_indexes_range().Enumerate(), -(this.loc + text_draw_vector())); } UICursor.update(); if (Grey_Cursor != null) { Grey_Cursor.force_loc(UICursor.target_loc); } if (index != this.index) { on_index_changed(index); } if (input) { if (Global.Input.touch_pressed(false)) { Vector2 loc = this.loc + Text_Offset + new Vector2(8, 8); if (Global.Input.touch_rectangle( Services.Input.InputStates.Triggered, new Rectangle((int)loc.X, (int)loc.Y, text_area_width, this.rows * 16))) { ManualScroll = true; Console.WriteLine("starting scroll"); } } else { ManualScroll = false; } if (ManualScroll && Global.Input.gesture_triggered(TouchGestures.VerticalDrag)) { ScrollOffset.Y += -Global.Input.verticalDragVector.Y; ScrollOffset.Y = MathHelper.Clamp(ScrollOffset.Y, 0, (this.total_rows - this.rows) * 16); refresh_scroll(); } } }
public override void draw_cursor(SpriteBatch sprite_batch) { if (Input.ControlScheme != ControlSchemes.Mouse) { if (Greyed_Cursor) { Grey_Cursor.draw(sprite_batch, -(loc + text_draw_vector())); } } if (!SettingSelected && active && Items.ActiveNode != null) { UICursor.draw(sprite_batch, -(loc + text_draw_vector())); } if (Input.ControlScheme != ControlSchemes.Mouse) { if (SettingSelected) { SelectedSettingCursor.draw(sprite_batch, -(loc + text_draw_vector())); } } }